Save the file Dataframe

View the online Dataframe how to save the results to a file has been tried and have failed, wrote on the blog are using the most: first import import org.apache.saprk.sql.SaveMode packages in the spark-shell model, then result.repartitione (1) .save ( "... / out.json", "json", SaveMode.Overwrite) in such a way to hold the result, no matter how I try all error

Here Insert Picture Description

I do not know what version of the problem or reason, save all the wrong version of the Spark-2.4.3 I am using, hive-2.3 .4, looking for a reason to solve this problem inform friends find it in this thanked.

Return to the topic since the problem lies in how to think not save it and then find other alternative to using the following approach

re here is that I've dealt with constant good results

re.write.mode(SaveMode.Overwrite).json("result.json")

Found no error really great
Here Insert Picture Description
view files for each column I found the results as a file storage
Here Insert Picture Description

Storing a file to be synthesized shall add repartition (1) or coalesce (1)

Here Insert Picture Description
Here Insert Picture Description

Stored locally

re.repartition(1).write.csv("file:/root/out")

Here Insert Picture Description
Here Insert Picture Description

Published 39 original articles · won praise 13 · views 2302

Guess you like

Origin blog.csdn.net/qq_43205282/article/details/103970798