gpt4 book ai didi

python - 输入记录与 python mapreduce 中的输出记录不匹配

转载 作者:可可西里 更新时间:2023-11-01 15:56:00 25 4
gpt4 key购买 nike

我正在用 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 行,但其他文件为空。请求帮助。提前致谢...

最佳答案

试试这个:

-mapper "python /path/to/mapper_try.py"

代替:

-mapper "mapper_try.py"

关于python - 输入记录与 python mapreduce 中的输出记录不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43819452/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com