You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/08 08:52:51 UTC

[GitHub] [spark] wangyum commented on a change in pull request #25960: [SPARK-29283][SQL] Error message is hidden when query from JDBC, especially enabled adaptive execution

wangyum commented on a change in pull request #25960: [SPARK-29283][SQL] Error message is hidden when query from JDBC, especially enabled adaptive execution
URL: https://github.com/apache/spark/pull/25960#discussion_r332400890
 
 

 ##########
 File path: sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala
 ##########
 @@ -286,7 +287,9 @@ private[hive] class SparkExecuteStatementOperation(
           if (e.isInstanceOf[HiveSQLException]) {
             throw e.asInstanceOf[HiveSQLException]
           } else {
-            throw new HiveSQLException("Error running query: " + e.toString, e)
+            val root = ExceptionUtils.getRootCause(e)
 
 Review comment:
   Could we change it to?
   ```scala
   setState(OperationState.ERROR)
   e match {
     case hiveException: HiveSQLException =>
       logError(s"Error executing query with $statementId, currentState $currentState, ", e)
       HiveThriftServer2.listener.onStatementError(
         statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException))
       throw hiveException
     case _ =>
       val rootCause = Option(ExceptionUtils.getRootCause(e)).getOrElse(e)
       logError(
         s"Error executing query with $statementId, currentState $currentState, ", rootCause)
       HiveThriftServer2.listener.onStatementError(
         statementId, rootCause.getMessage, SparkUtils.exceptionString(rootCause))
       throw new HiveSQLException("Error running query: " + rootCause.toString, rootCause)
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org