Pig
  1. Pig
  2. PIG-2006

Regression: NPE when Pig processes an empty script file

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.0
    • Fix Version/s: 0.9.0
    • Component/s: None
    • Labels:
      None

      Description

      If a pig script file is empty and supplied as input for Pig (using -f option), an NPE is thrown. Stacktrace:

      java.lang.NullPointerException
      at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
      at java.util.regex.Matcher.reset(Matcher.java:291)
      at java.util.regex.Matcher.<init>(Matcher.java:211)
      at java.util.regex.Pattern.matcher(Pattern.java:888)
      at org.apache.pig.scripting.ScriptEngine$SupportedScriptLang.accepts(ScriptEngine.java:89)
      at org.apache.pig.scripting.ScriptEngine.getSupportedScriptLang(ScriptEngine.java:163)
      at org.apache.pig.Main.determineScriptType(Main.java:892)
      at org.apache.pig.Main.run(Main.java:378)
      at org.apache.pig.Main.main(Main.java:108)

      This seems related Jython support in 0.9.

      1. PIG-2006.patch
        2 kB
        Xuefu Zhang
      2. PIG-2006-1.patch
        0.5 kB
        Xuefu Zhang

        Activity

        Hide
        Richard Ding added a comment -

        +1

        Show
        Richard Ding added a comment - +1
        Hide
        Xuefu Zhang added a comment -

        Test-patch run:

        [exec] +1 overall.
        [exec]
        [exec] +1 @author. The patch does not contain any @author tags.
        [exec]
        [exec] +1 tests included. The patch appears to include 3 new or modified tests.
        [exec]
        [exec] +1 javadoc. The javadoc tool did not generate any warning messages.
        [exec]
        [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings.
        [exec]
        [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings.
        [exec]
        [exec] +1 release audit. The applied patch does not increase the total number of release audit warnings.

        Show
        Xuefu Zhang added a comment - Test-patch run: [exec] +1 overall. [exec] [exec] +1 @author. The patch does not contain any @author tags. [exec] [exec] +1 tests included. The patch appears to include 3 new or modified tests. [exec] [exec] +1 javadoc. The javadoc tool did not generate any warning messages. [exec] [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. [exec] [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings. [exec] [exec] +1 release audit. The applied patch does not increase the total number of release audit warnings.
        Hide
        Xuefu Zhang added a comment -

        Patch is committed to both trunk and 0.9 branch. Issue is resolved.

        Show
        Xuefu Zhang added a comment - Patch is committed to both trunk and 0.9 branch. Issue is resolved.
        Hide
        Xuefu Zhang added a comment -

        The newly added test case fails when running as part of unit test set.

        Show
        Xuefu Zhang added a comment - The newly added test case fails when running as part of unit test set.
        Hide
        Xuefu Zhang added a comment -

        Fix the failing test case.

        Show
        Xuefu Zhang added a comment - Fix the failing test case.

          People

          • Assignee:
            Xuefu Zhang
            Reporter:
            Xuefu Zhang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development