使用mapreduce中的windows azure存储执行reduce函数后,无法看到最终结果

snvhrwxg  于 2021-06-04  发布在  Hadoop
关注(0)|答案(1)|浏览(301)

我正在使用 c#.net 为了编写map和reduce函数,我基本上遵循了这里给出的示例
最后命令
hadoop jar hadoop-streaming.jar-文件“hdfs:///example/apps/map.exe,hdfs:///example/apps/reduce.exe”-input“/example/apps/data.csv”-output“/example/apps/output.txt”-mapper“map.exe”-reducer“reduce.exe”
作业已成功运行

现在从交互式js模式,如果我写

js> #cat /example/apps/output.txt

cat:文件不存在:/example/apps/output.txt
其中:

js> #ls /example/apps/output.txt

找到3项

-rw-r--r-- 3 xxxx supergroup 0 2013-02-22 10:23 /example/apps/output.txt/_SUCCESS

drwxr-xr-x - xxxx supergroup 0 2013-02-22 10:22 /example/apps/output.txt/_logs

-rw-r--r-- 3 xxxx supergroup 0 2013-02-22 10:23 /example/apps/output.txt/part-00000

我犯了什么错误?我怎样才能看到输出?

s6fujrry

s6fujrry1#

这个 -output 标志指定输出文件夹,而不是文件。因为可以有多个reducer,所以每个reducer将在这个文件夹中生成一个文件。
在本例中,您有一个reducer,它生成了一个文件: part-00000 . 如果有更多的还原剂,它们将被命名为 part-00001 , part-00002 等等。
命令 cat /example/apps/output.txt/part-00000 将显示您的输出。以后,不要命名输出文件夹 something.txt ,因为这只会让你和其他人困惑:)

相关问题