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

Ranking empty records leads to NullPointerException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.12.0
    • Fix Version/s: 0.13.0
    • Component/s: None
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Hadoop Flags:
      Reviewed

      Description

      steps to reproduce:

      1) create an empty file on hdfs (e.g. /user/root/test/empty.txt)
      2) execute the following pig script:

      records = LOAD '/user/root/test/empty.txt' AS (Amount: DOUBLE);
      ranked = RANK records BY Amount DESC;
      DUMP ranked;

      3) on console you will get " ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2043: Unexpected error during execution." and in pig's logs you will see:

      Pig Stack Trace

      ---------------
      ERROR 2043: Unexpected error during execution.
      
      org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias ranked
      at org.apache.pig.PigServer.openIterator(PigServer.java:880)
      at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:774)
      at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:372)
      at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:198)
      at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:173)
      at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
      at org.apache.pig.Main.run(Main.java:607)
      at org.apache.pig.Main.main(Main.java:156)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
      Caused by: org.apache.pig.PigException: ERROR 1002: Unable to store alias ranked
      at org.apache.pig.PigServer.storeEx(PigServer.java:982)
      at org.apache.pig.PigServer.store(PigServer.java:942)
      at org.apache.pig.PigServer.openIterator(PigServer.java:855)
      ... 12 more
      Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 2043: Unexpected error during execution.
      at org.apache.pig.PigServer.launchPlan(PigServer.java:1333)
      at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1307)
      at org.apache.pig.PigServer.storeEx(PigServer.java:978)
      ... 14 more
      Caused by: java.lang.RuntimeException: Error to read counters into Rank operation counterSize 0
      at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.saveCounters(JobControlCompiler.java:386)
      at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.updateMROpPlan(JobControlCompiler.java:332)
      at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:387)
      at org.apache.pig.PigServer.launchPlan(PigServer.java:1322)
      ... 16 more
      Caused by: java.lang.NullPointerException
      at org.apache.hadoop.mapreduce.counters.Limits.filterName(Limits.java:44)
      at org.apache.hadoop.mapreduce.counters.Limits.filterGroupName(Limits.java:52)
      at org.apache.hadoop.mapreduce.counters.AbstractCounters.getGroup(AbstractCounters.java:220)
      at org.apache.hadoop.mapred.Counters.getGroup(Counters.java:113)
      at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.saveCounters(JobControlCompiler.java:360)
      ... 19 more
      ================================================================================
      

        Attachments

        1. emptyRecordsNPE.patch
          3 kB
          Mykhaylo Telizhyn
        2. PIG-3726.patch
          3 kB
          Jarek Jarcec Cecho
        3. PIG-3726.patch
          2 kB
          Jarek Jarcec Cecho

          Activity

            People

            • Assignee:
              jarcec Jarek Jarcec Cecho
              Reporter:
              mtelizhyn Mykhaylo Telizhyn
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: