如何将 Spark RDD 保存到本地文件系统 [英] How to save Spark RDD to local filesystem

查看:24
本文介绍了如何将 Spark RDD 保存到本地文件系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 saveAsTextFile 语法将文件保存到本地系统中吗?这是我编写保存文件的语法的方式:insert_df.rdd.saveAsTextFile("<local path>")

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>")

当我尝试这样做时,我收到错误消息,因为没有权限,但我拥有该特定本地路径的所有权限,看起来它正在将该文件视为 HDFS 文件.

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.

推荐答案

我觉得你应该试试 "file:///local path" 而不是 "/local path".

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

这篇关于如何将 Spark RDD 保存到本地文件系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆