Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-6012

DBInputSplit creates invalid ranges on Oracle

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.1, 2.4.1
    • 1.3.0, 2.6.0
    • None
    • None
    • Reviewed

    Description

      The DBInputFormat on Oracle does not create valid ranges.

      The method getSplit line 263 is as follows:

      split = new DBInputSplit(i * chunkSize, (i * chunkSize) + chunkSize);

      So the first split will have a start value of 0 (0*chunkSize).

      However, the OracleDBRecordReader, line 84 is as follows:

      if (split.getLength() > 0 && split.getStart() > 0){

      Since the start value of the first range is equal to 0, we will skip the block that partitions the input set. As a result, one of the map task will process the entire data set, rather than the partition.

      I'm assuming the fix is trivial and would involve removing the second check in the if block.

      Also, I believe the OracleDBRecordReader paging query is incorrect.

      Line 92 should read:

      query.append(" ) WHERE dbif_rno > ").append(split.getStart());

      instead of (note > instead of >=)

      query.append(" ) WHERE dbif_rno >= ").append(split.getStart());

      Otherwise some rows will be ignored and some counted more than once.

      A map/reduce job that counts the number of rows based on a predicate will highlight the incorrect behavior.

      Attachments

        1. HADOOP-9530.patch
          1 kB
          Wei Yan
        2. MAPREDUCE-6012-branch-1.patch
          1 kB
          Wei Yan
        3. MAPREDUCE-6012-2-branch2.patch
          3 kB
          Wei Yan

        Issue Links

          Activity

            People

              ywskycn Wei Yan
              jserdaru Julien Serdaru
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: