[ https://issues.apache.org/jira/browse/SPARK-2814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cheng Lian updated SPARK-2814: ------------------------------ Description: After [PR #1686|https://github.com/apache/spark/pull/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: {code} ====================== 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) ... {code} was: After [PR #1686|https://github.com/apache/spark/pull/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. Reproduction steps: # Start HiveThriftServer2 # Connect to it via beeline # Execute `set;` Exception thrown: {code} ====================== 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) ... {code} > HiveThriftServer throws NPE when executing native commands > ---------------------------------------------------------- > > Key: SPARK-2814 > URL: https://issues.apache.org/jira/browse/SPARK-2814 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 1.1.0 > Reporter: Cheng Lian > > After [PR #1686|https://github.com/apache/spark/pull/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: > {code} > ====================== > 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) > ... > {code} -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org