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

Piggybank: MIN and MAX functions should ignore nulls

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.10.1
    • Fix Version/s: 0.13.0
    • Component/s: tools
    • Labels:
    • Release Note:
      Hide
      All I did was go through all of the Max and Min functions in Piggybank and add
      if (first==null)
          return second;
      if (second==null)
          return first;

      Following conversation on the message board, the desired outputs are:
      null,null -> null
      1,null -> 1
      null,1 -> 1
      1,1 -> 1

      This change gives that.
      Show
      All I did was go through all of the Max and Min functions in Piggybank and add if (first==null)     return second; if (second==null)     return first; Following conversation on the message board, the desired outputs are: null,null -> null 1,null -> 1 null,1 -> 1 1,1 -> 1 This change gives that.
    • Tags:
      piggybank

      Description

      org.apache.pig.piggybank.evaluation.math.MAX and org.apache.pig.piggybank.evaluation.math.MIN throws a NullPointerException on a null input, when it should just ignore it.

        Attachments

        1. JcoMaxMinPatch.patch
          7 kB
          Jonathan Coveney
        2. JcoMaxMinPatch_wtests.patch
          23 kB
          Jonathan Coveney
        3. PIG-2132_1.patch
          51 kB
          Rekha Joshi
        4. PIG-2132_2.patch
          7 kB
          Cheolsoo Park

          Activity

            People

            • Assignee:
              rekhajoshm Rekha Joshi
              Reporter:
              jcoveney Jonathan Coveney
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Remaining Estimate - 4h
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified