How to save Spark RDD to local filesystem

2019-06-25 19:15发布

问题:

can i save a file into the local system with the saveAsTextFile syntax ? This is how i'm writing the syntax to save a file: insert_df.rdd.saveAsTextFile("<local path>")

when i'm trying to do this i'm getting error as no permissions, but i have all the permissions to that specific local path, looks like it is treating the file as HDFS file.

回答1:

I think you should try "file:///local path" instead of "/local path".