Priya v v
Priya v v

Reputation: 163

How Map and Reduce operations are actually carried out

I have gone through this question., can anyone give the correct answer with explanation?

Which best describes how TextInputFormat processes input files and line breaks?

A. Input file splits may cross line breaks. A line that crosses file splits is read by the RecordReader of the split that contains the beginning of the broken line.

B. Input file splits may cross line breaks. A line that crosses file splits is read by the RecordReaders of both splits containing the broken line.

C. The input file is split exactly at the line breaks, so each RecordReader will read a series of complete lines.

D. Input file splits may cross line breaks. A line that crosses file splits is ignored.

E. Input file splits may cross line breaks. A line that crosses file splits is read by the RecordReader of the split that contains the end of the broken line.

Thanks in advance

Upvotes: 0

Views: 124

Answers (1)

Vignesh I
Vignesh I

Reputation: 2221

Linerecordreader reads value for a map call until it encounters a new line(or a different delimiter if specified) with the help of below call for textinputformat type. So obviously a record will never end until it encounters a new line.

newSize = in.readLine(value, maxLineLength, Math.max((int)Math.min(Integer.MAX_VALUE, end-pos),maxLineLength));

So Option A hold good.

Input file splits may cross line breaks. A line that crosses file splits is read by the RecordReader of the split that contains the beginning of the broken line.

Upvotes: 0

Related Questions