aboutsummaryrefslogtreecommitdiff
path: root/sql/hive-thriftserver
diff options
context:
space:
mode:
authorCheng Hao <hao.cheng@intel.com>2014-08-01 11:42:05 -0700
committerMichael Armbrust <michael@databricks.com>2014-08-01 11:42:05 -0700
commitc0b47bada3c9f0e9e0f14ab41ffb91012a357211 (patch)
treee948889fd25df43f35d33b8baddb195e87968a59 /sql/hive-thriftserver
parent580c7011cab6bc93294b6486e778557216bedb10 (diff)
downloadspark-c0b47bada3c9f0e9e0f14ab41ffb91012a357211.tar.gz
spark-c0b47bada3c9f0e9e0f14ab41ffb91012a357211.tar.bz2
spark-c0b47bada3c9f0e9e0f14ab41ffb91012a357211.zip
[SPARK-2767] [SQL] SparkSQL CLI doens't output error message if query failed.
Author: Cheng Hao <hao.cheng@intel.com> Closes #1686 from chenghao-intel/spark_sql_cli and squashes the following commits: eb664cc [Cheng Hao] Output detailed failure message in console 93b0382 [Cheng Hao] Fix Bug of no output in cli if exception thrown internally
Diffstat (limited to 'sql/hive-thriftserver')
-rwxr-xr-xsql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala4
-rw-r--r--sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala3
2 files changed, 4 insertions, 3 deletions
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
index 27268ecb92..cb17d7ce58 100755
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
@@ -288,8 +288,10 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging {
out.println(cmd)
}
- ret = driver.run(cmd).getResponseCode
+ val rc = driver.run(cmd)
+ ret = rc.getResponseCode
if (ret != 0) {
+ console.printError(rc.getErrorMessage())
driver.close()
return ret
}
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala
index 5202aa9903..a56b19a4bc 100644
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala
@@ -53,10 +53,9 @@ private[hive] class SparkSQLDriver(val context: HiveContext = SparkSQLEnv.hiveCo
}
override def run(command: String): CommandProcessorResponse = {
- val execution = context.executePlan(context.hql(command).logicalPlan)
-
// TODO unify the error code
try {
+ val execution = context.executePlan(context.hql(command).logicalPlan)
hiveResponse = execution.stringResult()
tableSchema = getResultSetSchema(execution)
new CommandProcessorResponse(0)