实际上我的意图是将hadoop作业的输出重命名为.csv
文件,因为我需要在rapidminer中可视化这个csv数据。
在我如何以 csv 格式输出 hadoop 结果中说,为此我需要遵循以下三个步骤:
1. Submit the MapReduce Job
2. Which will extract the output from HDFS using shell commands
3. Merge them together, rename as ".csv" and place in a directory where the visualization tool can access the final file
如果是这样,我怎样才能做到这一点?
更新
myjob.sh
:
bin/hadoop jar /var/root/ALA/ala_jar/clsperformance.jar ala.clsperf.ClsPerf /user/root/ala_xmlrpt/Amrita\ Vidyalayam\,\ Karwar_Class\ 1\ B_ENG.xml /user/root/ala_xmlrpt-outputshell4
bin/hadoop fs -get /user/root/ala_xmlrpt-outputshell4/part-r-00000 /Users/jobsubmit
cat /Users/jobsubmit/part-r-00000 /Users/jobsubmit/output.csv
显示:
The CSV file was empty and couldn’t be imported.
当我试图打开output.csv
.
解决方案
cat /Users/jobsubmit/part-r-00000> /Users/jobsubmit/output.csv