Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-5571

TupleWritable can return incorrect results if it contains more than 32 values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.19.1
    • 0.20.0
    • None
    • None
    • Reviewed

    Description

      When attempting to do an outer join on 45 files with the CompositeInputFormat, I've been encountering unexpected results in the TupleWritable returned by the record reader. On closer inspection, it seems to be because TupleWritable.setWritten(int) is incorrectly setting some tuple positions as written, i.e when you set setWritten(42), it also sets position 10.

      The following Junit test demonstrates the problem:

        public void testWideTuple() throws Exception {
          Text emptyText = new Text("Should be empty");
          Writable[] values = new Writable[64];
          Arrays.fill(values,emptyText);
          values[42] = new Text("Number 42");
                                           
          TupleWritable tuple = new TupleWritable(values);
          tuple.setWritten(42);
          
          for (int pos=0; pos<tuple.size();pos++) {
            boolean has = tuple.has(pos);
            if (pos == 42) {
              assertTrue(has);
            }
            else {
              assertFalse("Tuple position is incorrectly labelled as set: " + pos, has);
            }
          }
      }
      

      Similarly, TupleWritable.setWritten(9) also causes TupleWritable.has(41) to incorrectly return true.

      Attachments

        1. HADOOP-5571-1.patch
          3 kB
          Jingkei Ly

        Activity

          People

            jly Jingkei Ly
            jly Jingkei Ly
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: