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:
- Start HiveThriftServer2
- Connect to it via beeline
- 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
- is related to
-
SPARK-4037 NPE in JDBC server when calling SET
- Resolved
- links to