Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-2814

HiveThriftServer throws NPE when executing native commands

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 1.1.0
    • SQL
    • None

    Description

      After PR #1686, HiveThriftServer2 throws exception when executing native commands.

      The reason is that initialization of HiveContext.sessionState.out and HiveContext.sessionState.err were made lazy, while HiveThriftServer2 uses an overriden version of HiveContext that doesn't know how to initialize these two streams. When HiveContext.runHive tries to write to HiveContext.sessionState.out, an NPE is throw.

      Reproduction steps:

      1. Start HiveThriftServer2
      2. Connect to it via beeline
      3. Execute `set;`

      Exception thrown:

      ======================
      HIVE FAILURE OUTPUT
      ======================
      
      
      ======================
      END HIVE FAILURE OUTPUT
      ======================
      
      14/08/03 21:30:55 ERROR SparkSQLOperationManager: Error executing query:
      java.lang.NullPointerException
              at org.apache.spark.sql.hive.HiveContext.runHive(HiveContext.scala:210)
              at org.apache.spark.sql.hive.HiveContext.runSqlHive(HiveContext.scala:173)
              at org.apache.spark.sql.hive.HiveContext.set(HiveContext.scala:144)
              at org.apache.spark.sql.execution.SetCommand.sideEffectResult$lzycompute(commands.scala:59)
              at org.apache.spark.sql.execution.SetCommand.sideEffectResult(commands.scala:50)
              ...
      

      Attachments

        Issue Links

          Activity

            People

              lian cheng Cheng Lian
              lian cheng Cheng Lian
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: