Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-7292 Hive on Spark
  3. HIVE-8751

Null Pointer Exception when counter is used for stats during inserting overwrite partitioned tables [Spark Branch]

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The following quries cause NullPointerException

      set hive.stats.dbclass=counter;
      set hive.stats.autogather=true;
      set hive.exec.dynamic.partition.mode=nonstrict;
      
      create table dummy (key string, value string) partitioned by (ds string, hr string);
      insert overwrite table dummy partition (ds='10',hr='11') select * from src;
      

      Here is the stacktrace

      2014-11-05 15:30:42,621 ERROR [main] exec.Task (SparkTask.java:execute(116)) - Failed to execute spark task.
      java.lang.NullPointerException
      	at org.apache.hadoop.hive.ql.exec.spark.SparkTask.getRequiredCounterPrefix(SparkTask.java:235)
      	at org.apache.hadoop.hive.ql.exec.spark.SparkTask.execute(SparkTask.java:103)
      	at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:161)
      	at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:85)
      	at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1644)
      	at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1404)
      	at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1216)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1043)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1033)
      	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:247)
      	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:199)
      	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:410)
      	at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:783)
      	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:677)
      	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:616)
      	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)
      FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.spark.SparkTask
      

      The cause of this NullPointerException is that the SparkTask tries to get table partition info to set RequiredCounterPrefix before data are actually inserted to the partitioned table. Therefore, a null partition info is returned.

        Attachments

          Activity

            People

            • Assignee:
              nyang Na Yang
              Reporter:
              nyang Na Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: