AngersZhuuuu commented on a change in pull request #25611: [SPARK-28901][SQL] 
SparkThriftServer's Cancel SQL Operation show it in JDBC Tab UI
URL: https://github.com/apache/spark/pull/25611#discussion_r320095042
 
 

 ##########
 File path: 
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala
 ##########
 @@ -249,32 +253,42 @@ private[hive] class SparkExecuteStatementOperation(
       }
       dataTypes = result.queryExecution.analyzed.output.map(_.dataType).toArray
     } catch {
-      case e: HiveSQLException =>
-        if (getStatus().getState() == OperationState.CANCELED) {
+      // Actually do need to catch Throwable as some failures don't inherit 
from Exception and
+      // HiveServer will silently swallow them.
+      case e: Throwable =>
+        val currentState = getStatus().getState()
+        if (currentState.isTerminal) {
 
 Review comment:
   > ocd nit: `if (getStatus.getState.isTerminal)` would make it consistent 
with other places in the file, and adding the `val currentState` now is not 
needed, as it's accessed only once anyway.
   
   We should show currentState in 
   
![image](https://user-images.githubusercontent.com/46485123/64146210-a5721980-ce4e-11e9-8209-f8bd62013baf.png)
   

----------------------------------------------------------------
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