pysaprk踩坑之-Using RDD of dict to inferSchema is deprecated.Use pyspark.sql.Row instead

1. The reason why the figure below cannot work is that the schema cannot be inferred from the dict
(Using RDD of dict to inferSchema is deprecated.Use pyspark.sql.Row instead) This is not an explicit error, it is a problem that I spent a long time finding .
Insert picture description here
The above picture can work with a string type, it is very essence, I did it
2. But it's not always true, the following picture is fine, haha,
Insert picture description here
this does not report an error because the function passed into the map returns a tuple

Guess you like

Origin blog.csdn.net/qq_38574975/article/details/107922933