yaooqinn commented on a change in pull request #1891:
URL: https://github.com/apache/incubator-kyuubi/pull/1891#discussion_r805655440



##########
File path: 
externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/FlinkSQLOperationManager.scala
##########
@@ -18,22 +18,38 @@
 package org.apache.kyuubi.engine.flink.operation
 
 import java.util
+import java.util.Locale
 
-import scala.collection.JavaConverters.asScalaBufferConverter
+import scala.collection.JavaConverters._
 
+import org.apache.kyuubi.config.KyuubiConf._
+import org.apache.kyuubi.config.KyuubiConf.OperationModes._
 import org.apache.kyuubi.engine.flink.result.Constants
+import org.apache.kyuubi.engine.flink.session.FlinkSessionImpl
 import org.apache.kyuubi.operation.{Operation, OperationManager}
 import org.apache.kyuubi.session.Session
 
 class FlinkSQLOperationManager extends 
OperationManager("FlinkSQLOperationManager") {
 
+  private lazy val operationModeDefault = getConf.get(OPERATION_PLAN_ONLY)
+
   override def newExecuteStatementOperation(
       session: Session,
       statement: String,
       confOverlay: Map[String, String],
       runAsync: Boolean,
       queryTimeout: Long): Operation = {
-    val op = new ExecuteStatement(session, statement, runAsync, queryTimeout)
+    val flinkSession = session.asInstanceOf[FlinkSessionImpl]
+    val mode =
+      flinkSession.sessionContext.getConfigMap.getOrDefault(
+        OPERATION_PLAN_ONLY.key,
+        flinkSession.normalizedConf.getOrElse(OPERATION_PLAN_ONLY.key, 
operationModeDefault))

Review comment:
       >  IMO, current implementation is correct.
   >
   
   
   Not exactly, 
   If we don't change(merge these configs) there first,
   
   before some `SetOperation(0)`s, as the `flinkSession.normalizedConf(1)` 
shall update `flinkSession.sessionContext.getConfigMap(2)`, the read-side 
performs (1) -> (2).
   
   After `SetOperation`s, now (2) itself contains newer settings from (0). the 
read-side perfroms (0) -> (1) -> (2), a.k.a a modified (2) -> (1).




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


Reply via email to