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


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala:
##########
@@ -76,27 +79,48 @@ class PlanOnlyStatement(
 
   override protected def runInternal(): Unit =
     try {
-      withLocalProperties {
-        SQLConf.withExistingConf(spark.sessionState.conf) {
-          val parsed = spark.sessionState.sqlParser.parsePlan(statement)
-          parsed match {
-            case cmd if planExcludes.contains(cmd.getClass.getSimpleName) =>
-              result = spark.sql(statement)
-              iter = new ArrayFetchIterator(result.collect())
-
-            case plan => style match {
-                case PlainStyle => explainWithPlainStyle(plan)
-                case JsonStyle => explainWithJsonStyle(plan)
-                case UnknownStyle => unknownStyleError(style)
-                case other => throw notSupportedStyleError(other, "Spark SQL")
-              }
-          }
+      if (queryTimeout > 0) {
+        val timeoutExecutor =
+          
ThreadUtils.newDaemonSingleThreadScheduledExecutor("query-timeout-thread", 
false)

Review Comment:
   In our production environment, we discovered that in the current 1.9.x 
version, when setting a timeout in plan-only mode, although the session in the 
Kyuubi server has timed out and closed, the driver in the Spark engine 
continues to parse and execute the plan. This causes memory to remain 
unavailable.
   
   



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