Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-5311

POReservoirSample fails for more than Integer.MAX_VALUE records

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.18.0
    • None
    • None
    • Reviewed

    Description

      https://github.com/apache/pig/blob/branch-0.17/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POReservoirSample.java#L128

      The rowProcessed is a int. When it exceeds the int range it wraps around and becomes a negative number throwing below exception. It needs to be changed to long.

      Caused by: java.lang.IllegalArgumentException: bound must be positive
        at java.util.Random.nextInt(Random.java:388)
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POReservoirSample.getNextTuple(POReservoirSample.java:128)
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:305)
        at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POForEach.getNextTuple(POForEach.java:284)
      

      Attachments

        1. PIG-5311-1.patch
          3 kB
          Rohini Palaniswamy
        2. PIG-5311-2.patch
          5 kB
          Rohini Palaniswamy
        3. PIG-5311-3.patch
          5 kB
          Rohini Palaniswamy

        Activity

          People

            rohini Rohini Palaniswamy
            rohini Rohini Palaniswamy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: