可以在HDFS上读取CSV文件 - Hadoop
我正在尝试读取一个CSV文件,但我会得到:no这样的文件或目录。
该文件位于TMP文件夹上。
这是命令:
I'm trying to read a csv file but i get : No such file or directory.
the file is on tmp folder.
This is the commands:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的文件不是
hdfs://user/hdfs/titles.csv
,这就是错误所说的。则应仅使用
cat titles.csv
您仅显示
ls
,而不是HDFS DFS -LS
,因此,如果要读取文件, 从HDFS开始,您需要先HDFS DFS -PUT TITLES.CSV/user/hdfs/
首先。 (并使用HDFS DFS -MKDIR -P/user/hdfs
创建用户目录,如果尚不存在)Your file is not at
hdfs:///user/hdfs/titles.csv
, and this is what the error is saying.You are only showing
ls
, nothdfs dfs -ls
, so you should be using justcat titles.csv
If you want to read a file from HDFS, you need to
hdfs dfs -put titles.csv /user/hdfs/
first. (And create the user directory usinghdfs dfs -mkdir -p /user/hdfs
if it doesn't already exist)