Pig
  1. Pig
  2. PIG-3490

Inconsistent NULL handling in ABS for different numeric types

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.11
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      ABS of NULL either throws NullPointerException or returns NULL. It depends on the numeric type of argument:
      IntAbs, LongAbs, FloatAbs – fails,
      DoubleAbs – returns NULL

      It's inconvenient. I'd rather prefer that ABS(NULL) always returns NULL.

        Activity

        Hide
        Rohini Palaniswamy added a comment -

        if (input == null || input.size() < 1 || input.get(0) == null)

        { return null; }

        needs to be done instead of

        if (input == null || input.size() == 0)
        return null;

        This needs fixing in a lot of builtin functions not just ABS.

        Show
        Rohini Palaniswamy added a comment - if (input == null || input.size() < 1 || input.get(0) == null) { return null; } needs to be done instead of if (input == null || input.size() == 0) return null; This needs fixing in a lot of builtin functions not just ABS.

          People

          • Assignee:
            Unassigned
            Reporter:
            Pavel Fedyakov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development