我在python中编写了一个map reduce程序。当我使用 -
运行它时,映射器工作正常cat input.csv|python mapper.py > output.tsv
但是当我使用下面的命令运行它时,我没有得到所需的输出 -
nohup hadoop jar /opt/mapr/hadoop/hadoop-2.7.0/share/hadoop/tools/lib/hadoop-streaming-2.7.0-mapr-1607.jar -Dmapreduce.job.queuename=queue_name -Dmapred.map.tasks=1000 -Dmapred.reduce.tasks=0 -input /path/sample_reduce.csv -output /path/map_output -mapper "mapper_try.py" -reducer NONE -file mapper_try.py > mapp_try2.out &
它表示该工作已成功完成,但我也得到以下内容 -
Map-Reduce Framework
Map input records=1096
Map output records=92
Input split bytes=122610
Spilled Records=0
Failed Shuffles=0
Merged Map outputs=0
GC time elapsed (ms)=0
CPU time spent (ms)=840560
Physical memory (bytes) snapshot=353314721792
Virtual memory (bytes) snapshot=4310996582400
Total committed heap usage (bytes)=2036214005760
我无法解决输入记录与输出记录不匹配的问题。输出文件全部创建,92个文件各有1行,但其他文件为空。请求帮助。提前谢谢......
答案 0 :(得分:0)
试试这个:
-mapper "python /path/to/mapper_try.py"
而不是:
-mapper "mapper_try.py"