ruanwenjun commented on code in PR #7249:
URL: https://github.com/apache/kyuubi/pull/7249#discussion_r2544225911


##########
externals/kyuubi-jdbc-engine/src/test/scala/org/apache/kyuubi/engine/jdbc/starrocks/StarRocksOperationWithEngineSuite.scala:
##########
@@ -75,4 +75,26 @@ class StarRocksOperationWithEngineSuite extends 
StarRocksOperationSuite with Hiv
       assert(tFetchResultsResp.getStatus.getStatusCode === 
TStatusCode.SUCCESS_STATUS)
     }
   }
+
+  test("starrocks - JDBC ExecuteStatement operation cancel should kill SQL 
statement") {
+    withSessionHandle { (client, handle) =>
+      val tExecuteStatementReq = new TExecuteStatementReq()
+      tExecuteStatementReq.setSessionHandle(handle)
+      tExecuteStatementReq.setStatement("SELECT sleep(1200)")
+      tExecuteStatementReq.setRunAsync(true)
+      val tExecuteStatementResp = client.ExecuteStatement(tExecuteStatementReq)
+
+      // todo:we need to improvement the cancel mechanism in starrocks server 
side,
+      //  once a query submitted, we should be able to cancel it immediately.

Review Comment:
   Sorry, I didn't express myself clearly. I moved this `todo` to 
`ExecuteStatement`. This is an issue present in all JDBC engine in kyuubi. When 
using asyn mode, the statement creation is delayed. If we cancel immediately 
after submitting the SQL, there is a chance the cancellation may fail. If the 
statement has not yet been created at that point,



##########
externals/kyuubi-jdbc-engine/src/test/scala/org/apache/kyuubi/engine/jdbc/starrocks/StarRocksOperationWithEngineSuite.scala:
##########
@@ -75,4 +75,26 @@ class StarRocksOperationWithEngineSuite extends 
StarRocksOperationSuite with Hiv
       assert(tFetchResultsResp.getStatus.getStatusCode === 
TStatusCode.SUCCESS_STATUS)
     }
   }
+
+  test("starrocks - JDBC ExecuteStatement operation cancel should kill SQL 
statement") {
+    withSessionHandle { (client, handle) =>
+      val tExecuteStatementReq = new TExecuteStatementReq()
+      tExecuteStatementReq.setSessionHandle(handle)
+      tExecuteStatementReq.setStatement("SELECT sleep(1200)")
+      tExecuteStatementReq.setRunAsync(true)
+      val tExecuteStatementResp = client.ExecuteStatement(tExecuteStatementReq)
+
+      // todo:we need to improvement the cancel mechanism in starrocks server 
side,
+      //  once a query submitted, we should be able to cancel it immediately.

Review Comment:
   Sorry, I didn't express myself clearly. I moved this `todo` to 
`ExecuteStatement`. 
   This is an issue present in all JDBC engine in kyuubi. When using asyn mode, 
the statement creation is delayed. If we cancel immediately after submitting 
the SQL, there is a chance the cancellation may fail. If the statement has not 
yet been created at that point,



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to