pan3793 commented on code in PR #7324:
URL: https://github.com/apache/kyuubi/pull/7324#discussion_r2792850589
##########
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:
this creates a new thread for each operation, it's too expensive. let's
follow the idea of https://github.com/apache/kyuubi/pull/7121 to create a
global ThreadScheduledExecutor shared by all operations.
Q: why plan-only stmt was not covered by that? I suppose it should be,
though I didn't take a deeper look yet
--
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]