Instead of doing the file merging on your own, you can delegate the entire merging of the reduce output files by calling:
hadoop fs -getmerge /output/dir/on/hdfs/ /desired/local/output/file.txt
Note This combines the HDFS files locally. Make sure you have enough disk space before running
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…