可以在HDFS上读取CSV文件 - Hadoop

发布于 2025-02-05 11:21:26 字数 164 浏览 2 评论 0原文

我正在尝试读取一个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:

1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜无邪 2025-02-12 11:21:26

您的文件不是 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, not hdfs dfs -ls, so you should be using just cat 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 using hdfs dfs -mkdir -p /user/hdfs if it doesn't already exist)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文