访问子目录中文件的 Hadoop Streaming 运行 命令是什么

What will be the Hadoop Streaming Run Command to access the files in the Sub Directory

我在 python 中为 hadoop Map-Reduce 框架编写了一个映射器程序。

我是通过命令执行的:

hadoop jar /usr/hdp/2.3.2.0-2950/hadoop-mapreduce/hadoop-streaming.jar -mapper "python wordcount_mapper.py" -file wordcount_mapper.py -input inputfile -output outputfile3

如果目录 inputfile 仅包含文件,则它工作正常。

但是如果目录 inputfile 中有子目录,它就无法工作并显示错误。就像我在 inputfile.

中的(KAKA 和 KAKU)中有两个子目录

错误显示:

16/07/20 17:01:40 ERROR streaming.StreamJob: Error Launching job : Not a file: hdfs://secondary/user/team/inputfile/kaka

所以,我的问题是将文件放入子目录的命令是什么。

使用正则表达式:

inputfile/* - 将适用于 1 级子目录

inputfile/*/* - 将适用于 2 级子目录

运行 如:

hadoop jar /usr/hdp/2.3.2.0-2950/hadoop-mapreduce/hadoop-streaming.jar -mapper "python wordcount_mapper.py" -file wordcount_mapper.py -input inputfile/* -output outputfile3