Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

MutlipleOutputs writing zero records to output file.

SOLVED Go to solution

MutlipleOutputs writing zero records to output file.

Explorer

I have mapreduce code, in which i have used multipleOutputs.write for writing the output fo my own file convention.

 

I have used following line.

 

multipleOutputs.write(new Text(line), NullWritable.get(),"srini-file");

 

But, i am getting file with srini-file-m-00000 with 0 records in it. However, if i have used context.write, then the output came properly.

Please let me know, if there is any important point i missed in multipleoutputs.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: MutlipleOutputs writing zero records to output file.

Master Guru
Are you ensuring to call multipleOutputs.close() in the cleanup phase? If that is not done, the file won't be closed up, and would be left hanging open for an hour during which you can't see any written data.

If you're already doing that, please share your code here so we can take a look at what may be going wrong.
2 REPLIES 2

Re: MutlipleOutputs writing zero records to output file.

Master Guru
Are you ensuring to call multipleOutputs.close() in the cleanup phase? If that is not done, the file won't be closed up, and would be left hanging open for an hour during which you can't see any written data.

If you're already doing that, please share your code here so we can take a look at what may be going wrong.
Highlighted

Re: MutlipleOutputs writing zero records to output file.

Explorer

Thank you Harsh