PrepAway - Latest Free Exam Questions & Answers

Which InputFormat would you use to complete the line: setInputFormat (________.class);

Given a directory of files with the following structure: line number, tab character, string:
Example:
1. abialkjfjkaoasdfjksdlkjhqweroij
2. kadf jhuwqounahagtnbvaswslmnbfgy
3. kjfteiomndscxeqalkzhtopedkfslkj
You want to send each line as one record to your Mapper. Which InputFormat would you use to
complete the line: setInputFormat (________.class);

PrepAway - Latest Free Exam Questions & Answers

A.
BDBInputFormat

B.
KeyValueTextInputFormat

C.
SequenceFileInputFormat

D.
SequenceFileAsTextInputFormat

Explanation:
Note:
The output format for your first MR job should be SequenceFileOutputFormat – this will store the
Key/Values output from the reducer in a binary format, that can then be read back in, in your
second MR job using SequenceFileInputFormat.
Reference:http://stackoverflow.com/questions/9721754/how-to-parse-customwritable-from-text-inhadoop(see answer 1 and then see the comment #1 for it)

7 Comments on “Which InputFormat would you use to complete the line: setInputFormat (________.class);

  1. dinesh says:

    KeyValueTextInputFormat is the answer, Question is not about passing value from MR1 to MR2. It is about how the record is passed to MR1.




    0



    0
  2. yogeswaran says:

    KeyValueTextInputFormat sounds right to me.

    Nothing is mentioned in question about the input data being in binary format. Hence option B sounds right.




    0



    0

Leave a Reply to seema sharma Cancel reply

Your email address will not be published. Required fields are marked *