Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-10851

HCatalog NullPointerException when using views in Pig

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 1.3.0
    • None
    • HCatalog, StorageHandler
    • None

    Description

      When trying to access a hive table view with HCatalog through Pig, a NullPointerException is thrown. I realize that it is documented here that HCatalog and views do not work for Pig:
      https://cwiki.apache.org/confluence/display/Hive/HCatalog+CLI#HCatalogCLI-Create/Drop/AlterView

      However, surfacing a NullPointerException is not the proper way to handle the incompatibility. Stack trace below:
      org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias A
      at org.apache.pig.PigServer.openIterator(PigServer.java:892)
      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.run(Grunt.java:69)
      at org.apache.pig.Main.run(Main.java:541)
      at org.apache.pig.Main.main(Main.java:156)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
      Caused by: org.apache.pig.PigException: ERROR 1002: Unable to store alias A
      at org.apache.pig.PigServer.storeEx(PigServer.java:994)
      at org.apache.pig.PigServer.store(PigServer.java:954)
      at org.apache.pig.PigServer.openIterator(PigServer.java:867)
      ... 13 more
      Caused by: org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException: ERROR 2017: Internal error creating job configuration.
      at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:873)
      at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(JobControlCompiler.java:298)
      at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:190)
      at org.apache.pig.PigServer.launchPlan(PigServer.java:1334)
      at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1319)
      at org.apache.pig.PigServer.storeEx(PigServer.java:990)
      ... 15 more
      Caused by: java.io.IOException: java.lang.NullPointerException
      at org.apache.hive.hcatalog.mapreduce.HCatInputFormat.setInput(HCatInputFormat.java:97)
      at org.apache.hive.hcatalog.mapreduce.HCatInputFormat.setInput(HCatInputFormat.java:61)
      at org.apache.hive.hcatalog.pig.HCatLoader.setLocation(HCatLoader.java:127)
      at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:498)
      ... 20 more
      Caused by: java.lang.NullPointerException
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:190)
      at org.apache.hive.hcatalog.mapreduce.FosterStorageHandler.<init>(FosterStorageHandler.java:59)
      at org.apache.hive.hcatalog.common.HCatUtil.getStorageHandler(HCatUtil.java:404)
      at org.apache.hive.hcatalog.common.HCatUtil.getStorageHandler(HCatUtil.java:367)
      at org.apache.hive.hcatalog.mapreduce.InitializeInput.extractPartInfo(InitializeInput.java:158)
      at org.apache.hive.hcatalog.mapreduce.InitializeInput.getInputJobInfo(InitializeInput.java:137)

      Attachments

        1. HIVE-10851.patch
          1 kB
          Aihua Xu

        Issue Links

          Activity

            People

              aihuaxu Aihua Xu
              cotedm Dustin Cote
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: