Note that there are some explanatory texts on larger screens.

plurals
  1. POHadoop Map-Reduce . RecordReader
    primarykey
    data
    text
    <p>I am trying to solve the following RecordReader problem . Example Input File :</p> <pre><code>1,1 2,2 3,3 4,4 5,5 6,6 7,7 ....... ....... </code></pre> <p>i want my RecordReader to return </p> <pre><code>key | Value 0 |1,1:2,2:3,3:4,4:5,5 4 |2,2:3,3:......6,6 6 |3,3:4,4......6,6,7,7 </code></pre> <p>(for first value first five line , for 2nd value five lines starting from 2nd line and for 3rd value five lines starting from 3rd line and so on )</p> <p><code>public class MyRecordReader extends RecordReader&lt;LongWritable, Text&gt; {</code></p> <pre><code>@Override public boolean nextKeyValue() throws IOException, InterruptedException { while (pos &lt; end) { key.set(pos); // five line logic Text nextLine=new Text(); int newSize = in.readLine(value, maxLineLength, Math.max((int)Math.min(Integer.MAX_VALUE, end-pos), maxLineLength)); fileSeek+=newSize; for(int n=0;n&lt;4;n++) { fileSeek+=in.readLine(nextLine, maxLineLength, Math.max((int)Math.min(Integer.MAX_VALUE, end-pos), maxLineLength)); value.append(":".getBytes(), 0,1); value.append(nextLine.getBytes(), 0, nextLine.getLength()); } if (newSize == 0) { return false; } pos += newSize; if (newSize &lt; maxLineLength) { return true; } // line too long. try again LOG.info("Skipped line of size " + newSize + " at pos " + (pos - newSize)); } return false; } </code></pre> <p>}</p> <p>But this is returning the values as </p> <pre><code>key | Value 0 |1,1:2,2:3,3:4,4:5,5 4 |6,6:7,7.......10,10 6 |11,11:12,12:......14,14 </code></pre> <p>can someone help me with this code or a fresh Code for RecodeReader will do as well ? <a href="https://stackoverflow.com/questions/12455088/how-to-calculate-centered-moving-average-of-a-set-on-data-hadoop-map-reduce">Requirement of the problem (may help you understand the use case)</a> Thanks </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload