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

Piggybank: MIN and MAX functions should ignore nulls

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.10.1
    • 0.13.0
    • tools
    • 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.
    • 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_wtests.patch
          23 kB
          Jonathan Coveney
        2. JcoMaxMinPatch.patch
          7 kB
          Jonathan Coveney
        3. PIG-2132_1.patch
          51 kB
          Rekha Joshi
        4. PIG-2132_2.patch
          7 kB
          Cheolsoo Park

        Activity

          People

            rekhajoshm Rekha Joshi
            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