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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to