简体   繁体   English

无法读取 hdfs 上的 csv 文件 - Hadoop

[英]can't read csv file on hdfs - Hadoop

I'm trying to read a csv file but i get : No such file or directory.我正在尝试读取 csv 文件,但我得到: No such file or directory.

the file is on tmp folder.该文件位于 tmp 文件夹中。

This is the commands:这是命令:

1

Your file is not at hdfs:///user/hdfs/titles.csv , and this is what the error is saying.您的文件不在hdfs:///user/hdfs/titles.csv ,这就是错误的意思。

You are only showing ls , not hdfs dfs -ls , so you should be using just cat titles.csv你只显示ls ,而不是hdfs dfs -ls ,所以你应该只使用cat titles.csv

If you want to read a file from HDFS, you need to hdfs dfs -put titles.csv /user/hdfs/ first.如果要从 HDFS 读取文件,则需要先hdfs dfs -put titles.csv /user/hdfs/ (And create the user directory using hdfs dfs -mkdir -p /user/hdfs if it doesn't already exist) (如果用户目录尚不存在,则使用hdfs dfs -mkdir -p /user/hdfs创建用户目录)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM