Manyu
Manyu

Reputation: 41

How can I export output files back to CSV after MapReduce result

I couldn't find a way out, how I can export Hadoop Mapreduce results back to, e.g. CSV or other file formats.

Does anyone know how to do this? Love to know.

Please note I am referring to the results from Hadoop, e.g. output1/part.00000

Upvotes: 0

Views: 1729

Answers (2)

dpsdce
dpsdce

Reputation: 5450

By Default they are actually TSV (tab separated) which you can change by setting

  mapred.textoutputformat.separator=","

and then you can download it from HDFS either by hdfs -get command , or using -merge command to get a merged output of all the part-ooo* files in a single local file

  hadoop fs -get hdfs://nn.example.com/user/hadoop/file localfile

or

  Usage: hadoop fs -getmerge <src> <localdst> [addnl]

Upvotes: 2

Tanveer
Tanveer

Reputation: 900

If you want to change delimiter between your key and value pair file generated out of your java map reduce code you can set :

mapred.textoutputformat.separator to ","

Upvotes: 0

Related Questions