Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

MutlipleOutputs writing zero records to output file.

avatar
Rising Star

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

avatar
Mentor
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.

View solution in original post

2 REPLIES 2

avatar
Mentor
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.

avatar
Rising Star

Thank you Harsh