This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new b8b9a2123 [KYUUBI #3711] PlanOnly should output engine logs to log 
files
b8b9a2123 is described below

commit b8b9a2123dec1c24a1e5c44331e1069f135be15a
Author: Yikf <[email protected]>
AuthorDate: Sat Oct 29 10:41:37 2022 +0000

    [KYUUBI #3711] PlanOnly should output engine logs to log files
    
    ### _Why are the changes needed?_
    
    Fix https://github.com/apache/incubator-kyuubi/issues/3711
    PlanOnly should output engine logs to log files so that they can be pulled 
from the front end.
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [ ] [Run 
test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #3712 from Yikf/planOnly-log-out.
    
    Closes #3711
    
    8469de9a [Yikf] planOnly should output engine logs to log files so that 
they can be pulled from the front end
    
    Authored-by: Yikf <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../org/apache/kyuubi/engine/flink/operation/PlanOnlyStatement.scala | 5 +++++
 .../org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala | 5 +++++
 2 files changed, 10 insertions(+)

diff --git 
a/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/PlanOnlyStatement.scala
 
b/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/PlanOnlyStatement.scala
index 5a7b8c10f..2aabc9b06 100644
--- 
a/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/PlanOnlyStatement.scala
+++ 
b/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/PlanOnlyStatement.scala
@@ -38,6 +38,11 @@ class PlanOnlyStatement(
   private val lineSeparator: String = System.lineSeparator()
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
+  override protected def beforeRun(): Unit = {
+    OperationLog.setCurrentOperationLog(operationLog)
+    super.beforeRun()
+  }
+
   override protected def runInternal(): Unit = {
     try {
       val operation = executor.parseStatement(sessionId, statement)
diff --git 
a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
 
b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
index 486e6bb63..b7e5451ec 100644
--- 
a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
+++ 
b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
@@ -60,6 +60,11 @@ class PlanOnlyStatement(
     } else result.schema
   }
 
+  override protected def beforeRun(): Unit = {
+    OperationLog.setCurrentOperationLog(operationLog)
+    super.beforeRun()
+  }
+
   override protected def runInternal(): Unit = withLocalProperties {
     try {
       SQLConf.withExistingConf(spark.sessionState.conf) {

Reply via email to