You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/02/17 07:19:00 UTC

[GitHub] [incubator-kyuubi] iodone opened a new pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

iodone opened a new pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921


   
   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
     2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   Close #1920 
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### _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
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] iodone commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
iodone commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809018475



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {
+    case Some(res) if res.isEmpty =>
+      new StructType().add("Result", "string")
+    case Some(res) =>
+      res.schema
+    case _ =>
       new StructType().add("plan", "string")
-    } else {
-      result.schema
-    }
+  }
 
-  private def isSetOrReset(plan: LogicalPlan): Boolean = {
+  private def shouldDirectRun(plan: LogicalPlan): Boolean = {
     val className = plan.getClass.getSimpleName
-    className == "SetCommand" || className == "ResetCommand"
+    className == "SetCommand" || className == "ResetCommand" || className == "UseStatement"

Review comment:
       Yes, I found this issue https://github.com/apache/spark/pull/34127 in the master branch which migrate `UseStatement` to v2 command framework and change it to `SetNamespaceCommand`, But Spark 3.1 and 3.2 still have `UseStatement`. Do our changes here need to be forward compatible like Spark 3.3?

##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {

Review comment:
       Ok




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (79d7ba6) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/9b42537164c2215549f0cead0c015f41d4725a65?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9b42537) will **decrease** coverage by `0.04%`.
   > The diff coverage is `15.38%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   - Coverage     60.87%   60.82%   -0.05%     
     Complexity       69       69              
   ============================================
     Files           302      302              
     Lines         14797    14807      +10     
     Branches       1915     1924       +9     
   ============================================
   - Hits           9007     9006       -1     
   - Misses         5020     5025       +5     
   - Partials        770      776       +6     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `48.88% <15.38%> (-13.97%)` | :arrow_down: |
   | [...org/apache/kyuubi/ha/client/ServiceDiscovery.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL2NsaWVudC9TZXJ2aWNlRGlzY292ZXJ5LnNjYWxh) | `89.28% <0.00%> (-3.58%)` | :arrow_down: |
   | [...rg/apache/kyuubi/engine/trino/TrinoStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdGVtZW50LnNjYWxh) | `67.46% <0.00%> (-2.41%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.44% <0.00%> (+0.14%)` | :arrow_up: |
   | [...n/scala/org/apache/kyuubi/engine/ProcBuilder.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9lbmdpbmUvUHJvY0J1aWxkZXIuc2NhbGE=) | `84.40% <0.00%> (+0.91%)` | :arrow_up: |
   | [...ache/kyuubi/operation/KyuubiOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uTWFuYWdlci5zY2FsYQ==) | `95.00% <0.00%> (+2.50%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9b42537...79d7ba6](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042653631


   @iodone, could you please add the test case for this change and skip the plan parsing of `UseStatement` in Flink engine?


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] cfmcgrady commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
cfmcgrady commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r811719564



##########
File path: kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala
##########
@@ -79,6 +79,35 @@ class PlanOnlyOperationSuite extends WithKyuubiServer with HiveJDBCTestHelper {
     }
   }
 
+  test("KYUUBI #1920: Plan only operations with Usestatement or SetNamespaceCommand skiped") {
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY.key -> NONE.toString))(Map.empty) {
+      withDatabases("test_database") { statement =>
+        statement.execute("create database test_database")
+        statement.execute(s"set ${KyuubiConf.OPERATION_PLAN_ONLY.key}=optimize")
+        val result = statement.executeQuery("use test_database")
+        assert(!result.next(), "In contrast to PlanOnly mode, it will returns an empty result")
+      }
+    }
+  }
+
+  test("KYUUBI #1920: Plan only operations with CacheTable skiped") {
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY.key -> OPTIMIZE.toString))(Map.empty) {
+      withJdbcStatement() { statement =>
+        val result = statement.executeQuery("cache table cached_table as select 1")
+        assert(!result.next(), "In contrast to PlanOnly mode, it will returns an empty result")
+      }
+    }
+  }
+
+  test("KYUUBI #1920: Plan only operations with CreateViewStatement or CreateViewCommand skiped") {
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY.key -> OPTIMIZE.toString))(Map.empty) {
+      withJdbcStatement() { statement =>
+        val result = statement.executeQuery("create temp view temp_view as select 1")

Review comment:
       nit: we should drop the temp view `temp_view` after the unit test is finished.

##########
File path: kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala
##########
@@ -79,6 +79,35 @@ class PlanOnlyOperationSuite extends WithKyuubiServer with HiveJDBCTestHelper {
     }
   }
 
+  test("KYUUBI #1920: Plan only operations with Usestatement or SetNamespaceCommand skiped") {
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY.key -> NONE.toString))(Map.empty) {
+      withDatabases("test_database") { statement =>
+        statement.execute("create database test_database")
+        statement.execute(s"set ${KyuubiConf.OPERATION_PLAN_ONLY.key}=optimize")
+        val result = statement.executeQuery("use test_database")
+        assert(!result.next(), "In contrast to PlanOnly mode, it will returns an empty result")
+      }
+    }
+  }
+
+  test("KYUUBI #1920: Plan only operations with CacheTable skiped") {
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY.key -> OPTIMIZE.toString))(Map.empty) {
+      withJdbcStatement() { statement =>

Review comment:
       diito.




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6069ccb) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/1d64bb279e3fdc2c7ea130d127f9ae9d8c435e67?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1d64bb2) will **decrease** coverage by `0.00%`.
   > The diff coverage is `50.00%`.
   
   > :exclamation: Current head 6069ccb differs from pull request most recent head 11b9fc9. Consider uploading reports for the commit 11b9fc9 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   - Coverage     60.96%   60.96%   -0.01%     
     Complexity       72       72              
   ============================================
     Files           304      304              
     Lines         14819    14803      -16     
     Branches       1915     1913       -2     
   ============================================
   - Hits           9034     9024      -10     
   + Misses         5015     5008       -7     
   - Partials        770      771       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `70.58% <50.00%> (+7.73%)` | :arrow_up: |
   | [...rg/apache/kyuubi/engine/trino/TrinoStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdGVtZW50LnNjYWxh) | `67.46% <0.00%> (-2.41%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.27% <0.00%> (-0.03%)` | :arrow_down: |
   | [...la/org/apache/kyuubi/session/AbstractSession.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXNzaW9uL0Fic3RyYWN0U2Vzc2lvbi5zY2FsYQ==) | `98.87% <0.00%> (ø)` | |
   | [...n/scala/org/apache/kyuubi/engine/ProcBuilder.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9lbmdpbmUvUHJvY0J1aWxkZXIuc2NhbGE=) | `87.25% <0.00%> (+2.85%)` | :arrow_up: |
   | [...ubi/engine/flink/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9mbGluay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `84.00% <0.00%> (+5.42%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [1d64bb2...11b9fc9](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a8c93f4) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/2501f9ad8348086b7b3ef2d65e378c24843ed224?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2501f9a) will **increase** coverage by `0.05%`.
   > The diff coverage is `85.71%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   + Coverage     60.92%   60.98%   +0.05%     
     Complexity       72       72              
   ============================================
     Files           303      304       +1     
     Lines         14768    14799      +31     
     Branches       1902     1910       +8     
   ============================================
   + Hits           8998     9025      +27     
   - Misses         5006     5007       +1     
   - Partials        764      767       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `78.12% <85.71%> (+2.26%)` | :arrow_up: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...n/scala/org/apache/kyuubi/KyuubiSQLException.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9LeXV1YmlTUUxFeGNlcHRpb24uc2NhbGE=) | `92.77% <0.00%> (-1.21%)` | :arrow_down: |
   | [...che/kyuubi/engine/trino/operation/GetColumns.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9HZXRDb2x1bW5zLnNjYWxh) | `88.88% <0.00%> (ø)` | |
   | [...engine/trino/operation/TrinoOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9Ucmlub09wZXJhdGlvbk1hbmFnZXIuc2NhbGE=) | `90.00% <0.00%> (+5.78%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [2501f9a...a8c93f4](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r810473115



##########
File path: kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala
##########
@@ -79,6 +79,19 @@ class PlanOnlyOperationSuite extends WithKyuubiServer with HiveJDBCTestHelper {
     }
   }
 
+  test("KYUUBI #1920: Plan only operations with skip Usestatement or SetNamespaceCommand") {
+    val createDatabaseStatement = "create database test_database"
+    val useStatement = "use test_database"
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY.key -> NONE.toString))(Map.empty) {
+      withDatabases("test_database") { statement =>
+        statement.execute(createDatabaseStatement)

Review comment:
       ```suggestion
           statement.execute("create database test_database")
   ```




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r810473077



##########
File path: kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala
##########
@@ -79,6 +79,19 @@ class PlanOnlyOperationSuite extends WithKyuubiServer with HiveJDBCTestHelper {
     }
   }
 
+  test("KYUUBI #1920: Plan only operations with skip Usestatement or SetNamespaceCommand") {

Review comment:
       ```suggestion
     test("KYUUBI #1920: Plan only operations with UseStatement or SetNamespaceCommand skip") {
   ```




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a8c93f4) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/2501f9ad8348086b7b3ef2d65e378c24843ed224?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2501f9a) will **increase** coverage by `0.05%`.
   > The diff coverage is `85.71%`.
   
   > :exclamation: Current head a8c93f4 differs from pull request most recent head b546c87. Consider uploading reports for the commit b546c87 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   + Coverage     60.92%   60.98%   +0.05%     
     Complexity       72       72              
   ============================================
     Files           303      304       +1     
     Lines         14768    14799      +31     
     Branches       1902     1910       +8     
   ============================================
   + Hits           8998     9025      +27     
   - Misses         5006     5007       +1     
   - Partials        764      767       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `78.12% <85.71%> (+2.26%)` | :arrow_up: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...n/scala/org/apache/kyuubi/KyuubiSQLException.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9LeXV1YmlTUUxFeGNlcHRpb24uc2NhbGE=) | `92.77% <0.00%> (-1.21%)` | :arrow_down: |
   | [...che/kyuubi/engine/trino/operation/GetColumns.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9HZXRDb2x1bW5zLnNjYWxh) | `88.88% <0.00%> (ø)` | |
   | [...engine/trino/operation/TrinoOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9Ucmlub09wZXJhdGlvbk1hbmFnZXIuc2NhbGE=) | `90.00% <0.00%> (+5.78%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [2501f9a...b546c87](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ec46431) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/6403224199d8cedcad9c8e0d98e2ff8be14c7062?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6403224) will **decrease** coverage by `0.00%`.
   > The diff coverage is `50.00%`.
   
   > :exclamation: Current head ec46431 differs from pull request most recent head 6069ccb. Consider uploading reports for the commit 6069ccb to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   - Coverage     60.99%   60.98%   -0.01%     
     Complexity       72       72              
   ============================================
     Files           304      304              
     Lines         14798    14803       +5     
     Branches       1909     1913       +4     
   ============================================
   + Hits           9026     9028       +2     
     Misses         5006     5006              
   - Partials        766      769       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `70.58% <50.00%> (-5.28%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...n/scala/org/apache/kyuubi/KyuubiSQLException.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9LeXV1YmlTUUxFeGNlcHRpb24uc2NhbGE=) | `93.97% <0.00%> (+1.20%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [6403224...6069ccb](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6069ccb) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/6403224199d8cedcad9c8e0d98e2ff8be14c7062?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6403224) will **decrease** coverage by `0.03%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   - Coverage     60.99%   60.96%   -0.04%     
     Complexity       72       72              
   ============================================
     Files           304      304              
     Lines         14798    14803       +5     
     Branches       1909     1913       +4     
   ============================================
   - Hits           9026     9024       -2     
   - Misses         5006     5008       +2     
   - Partials        766      771       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `70.58% <50.00%> (-5.28%)` | :arrow_down: |
   | [...rg/apache/kyuubi/engine/trino/TrinoStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdGVtZW50LnNjYWxh) | `67.46% <0.00%> (-2.41%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.27% <0.00%> (-0.15%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [6403224...6069ccb](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r808980911



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {
+    case Some(res) if res.isEmpty =>
+      new StructType().add("Result", "string")
+    case Some(res) =>
+      res.schema
+    case _ =>
       new StructType().add("plan", "string")
-    } else {
-      result.schema
-    }
+  }
 
-  private def isSetOrReset(plan: LogicalPlan): Boolean = {
+  private def shouldDirectRun(plan: LogicalPlan): Boolean = {
     val className = plan.getClass.getSimpleName
-    className == "SetCommand" || className == "ResetCommand"
+    className == "SetCommand" || className == "ResetCommand" || className == "UseStatement"

Review comment:
       I did't find `UseStatement` at spark's master branch




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (70ce8de) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/74abe8510c3a01283e52d8ba59a7fe350e42434e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (74abe85) will **increase** coverage by `0.09%`.
   > The diff coverage is `25.00%`.
   
   > :exclamation: Current head 70ce8de differs from pull request most recent head e1ecf2c. Consider uploading reports for the commit e1ecf2c to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   + Coverage     60.84%   60.94%   +0.09%     
   - Complexity       69       72       +3     
   ============================================
     Files           302      304       +2     
     Lines         14797    14824      +27     
     Branches       1915     1919       +4     
   ============================================
   + Hits           9003     9034      +31     
   + Misses         5023     5016       -7     
   - Partials        771      774       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `55.00% <25.00%> (-7.86%)` | :arrow_down: |
   | [.../kyuubi/sql/zorder/OptimizeZorderCommandBase.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstY29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC96b3JkZXIvT3B0aW1pemVab3JkZXJDb21tYW5kQmFzZS5zY2FsYQ==) | `77.27% <0.00%> (-4.55%)` | :arrow_down: |
   | [...cala/org/apache/kyuubi/sql/zorder/ZorderBase.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstY29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC96b3JkZXIvWm9yZGVyQmFzZS5zY2FsYQ==) | `85.00% <0.00%> (-2.50%)` | :arrow_down: |
   | [.../org/apache/kyuubi/jdbc/hive/KyuubiConnection.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhpdmUtamRiYy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUva3l1dWJpL2pkYmMvaGl2ZS9LeXV1YmlDb25uZWN0aW9uLmphdmE=) | `4.28% <0.00%> (-0.09%)` | :arrow_down: |
   | [.../apache/hive/beeline/KyuubiDatabaseConnection.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhpdmUtYmVlbGluZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaGl2ZS9iZWVsaW5lL0t5dXViaURhdGFiYXNlQ29ubmVjdGlvbi5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...yuubi/sql/zorder/OptimizeZorderStatementBase.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstY29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC96b3JkZXIvT3B0aW1pemVab3JkZXJTdGF0ZW1lbnRCYXNlLnNjYWxh) | `71.42% <0.00%> (ø)` | |
   | [...org/apache/kyuubi/sql/RebalanceBeforeWriting.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstMy0yL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9SZWJhbGFuY2VCZWZvcmVXcml0aW5nLnNjYWxh) | | |
   | [...ql/sqlclassification/KyuubiSqlClassification.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstMy0xL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9zcWxjbGFzc2lmaWNhdGlvbi9LeXV1YmlTcWxDbGFzc2lmaWNhdGlvbi5zY2FsYQ==) | `66.66% <0.00%> (ø)` | |
   | [...sqlclassification/KyuubiGetSqlClassification.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstMy0xL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9zcWxjbGFzc2lmaWNhdGlvbi9LeXV1YmlHZXRTcWxDbGFzc2lmaWNhdGlvbi5zY2FsYQ==) | `76.47% <0.00%> (ø)` | |
   | [...g/apache/kyuubi/sql/RepartitionBeforeWriting.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstMy0xL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9SZXBhcnRpdGlvbkJlZm9yZVdyaXRpbmcuc2NhbGE=) | `90.47% <0.00%> (ø)` | |
   | ... and [3 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [74abe85...e1ecf2c](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d759b03) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/6403224199d8cedcad9c8e0d98e2ff8be14c7062?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6403224) will **decrease** coverage by `0.01%`.
   > The diff coverage is `50.00%`.
   
   > :exclamation: Current head d759b03 differs from pull request most recent head 6069ccb. Consider uploading reports for the commit 6069ccb to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   - Coverage     60.99%   60.98%   -0.02%     
     Complexity       72       72              
   ============================================
     Files           304      304              
     Lines         14798    14803       +5     
     Branches       1909     1913       +4     
   ============================================
   + Hits           9026     9027       +1     
     Misses         5006     5006              
   - Partials        766      770       +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `70.58% <50.00%> (-5.28%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [6403224...6069ccb](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809625045



##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatementSuite.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.operation
+
+import java.sql.SQLException
+
+import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
+
+class PlanOnlyStatementSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {

Review comment:
       yea, better choice




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (70ce8de) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/1d64bb279e3fdc2c7ea130d127f9ae9d8c435e67?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1d64bb2) will **decrease** coverage by `0.02%`.
   > The diff coverage is `25.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   - Coverage     60.96%   60.94%   -0.03%     
     Complexity       72       72              
   ============================================
     Files           304      304              
     Lines         14819    14824       +5     
     Branches       1915     1919       +4     
   ============================================
     Hits           9034     9034              
   - Misses         5015     5016       +1     
   - Partials        770      774       +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `55.00% <25.00%> (-7.86%)` | :arrow_down: |
   | [...ache/kyuubi/operation/KyuubiOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uTWFuYWdlci5zY2FsYQ==) | `92.50% <0.00%> (-2.50%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.44% <0.00%> (+0.14%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [1d64bb2...70ce8de](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809614550



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {
+    case Some(res) if res.isEmpty =>
+      new StructType().add("Result", "string")
+    case Some(res) =>
+      res.schema
+    case _ =>
       new StructType().add("plan", "string")
-    } else {
-      result.schema
-    }
+  }
 
-  private def isSetOrReset(plan: LogicalPlan): Boolean = {
+  private def shouldDirectRun(plan: LogicalPlan): Boolean = {
     val className = plan.getClass.getSimpleName
-    className == "SetCommand" || className == "ResetCommand"
+    className == "SetCommand" || className == "ResetCommand" || className == "UseStatement"

Review comment:
       In Spark 3.0, `UseStatement` is replaced with `SetNamespaceCommand`, which changes in [https://github.com/apache/spark/pull/34127](https://github.com/apache/spark/pull/34127).




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809616921



##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatementSuite.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.operation
+
+import java.sql.SQLException
+
+import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
+
+class PlanOnlyStatementSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
+  override protected def jdbcUrl: String = getJdbcUrl
+  override def withKyuubiConf: Map[String, String] = Map.empty
+
+  test("Plan only operations - skip use statement") {
+    val createDatabaseStatement = "create database test_database"
+    val createTableStatement = "create table test_database.t(a int) using parquet"
+    val selectStatement = "select * from t"
+    val useStatement = "use test_database"
+    withJdbcStatement("t") { statement =>
+      statement.executeQuery(createDatabaseStatement)

Review comment:
       Why not use `statement#execute`?

##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatementSuite.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.operation
+
+import java.sql.SQLException
+
+import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
+
+class PlanOnlyStatementSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
+  override protected def jdbcUrl: String = getJdbcUrl
+  override def withKyuubiConf: Map[String, String] = Map.empty
+
+  test("Plan only operations - skip use statement") {
+    val createDatabaseStatement = "create database test_database"

Review comment:
       IMO, this doesn't need to create variable. 

##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatementSuite.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.operation
+
+import java.sql.SQLException
+
+import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
+
+class PlanOnlyStatementSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
+  override protected def jdbcUrl: String = getJdbcUrl
+  override def withKyuubiConf: Map[String, String] = Map.empty
+
+  test("Plan only operations - skip use statement") {
+    val createDatabaseStatement = "create database test_database"
+    val createTableStatement = "create table test_database.t(a int) using parquet"
+    val selectStatement = "select * from t"
+    val useStatement = "use test_database"
+    withJdbcStatement("t") { statement =>
+      statement.executeQuery(createDatabaseStatement)
+      statement.executeQuery(createTableStatement)
+
+      statement.execute("SET kyuubi.operation.plan.only.mode=parse")
+      val set0 = statement.executeQuery(selectStatement)
+      assert(set0.next())
+      assert(set0.getString("plan") contains "UnresolvedRelation")
+
+      statement.execute("SET kyuubi.operation.plan.only.mode=optimize")
+      val e0 = intercept[SQLException](statement.executeQuery(selectStatement))
+      assert(e0.getMessage.contains("Table or view not found"))
+
+      // execute UseStatement with plan-only mode to switch current database to 'test_database'

Review comment:
       ```suggestion
         // execute SetNamespaceCommand with plan-only mode to switch current database to 'test_database'
   ```

##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatementSuite.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.operation
+
+import java.sql.SQLException
+
+import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
+
+class PlanOnlyStatementSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {

Review comment:
       Why not add this test case in `org.apache.kyuubi.operation. PlanOnlyStatementSuite`?
   cc @yaooqinn 

##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatementSuite.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.operation
+
+import java.sql.SQLException
+
+import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
+
+class PlanOnlyStatementSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
+  override protected def jdbcUrl: String = getJdbcUrl
+  override def withKyuubiConf: Map[String, String] = Map.empty
+
+  test("Plan only operations - skip use statement") {

Review comment:
       ```suggestion
     test("Plan only operation with set namespace command") {
   ```




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b546c87) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/2501f9ad8348086b7b3ef2d65e378c24843ed224?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2501f9a) will **increase** coverage by `0.02%`.
   > The diff coverage is `85.71%`.
   
   > :exclamation: Current head b546c87 differs from pull request most recent head 45bc05f. Consider uploading reports for the commit 45bc05f to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   + Coverage     60.92%   60.95%   +0.02%     
     Complexity       72       72              
   ============================================
     Files           303      304       +1     
     Lines         14768    14799      +31     
     Branches       1902     1910       +8     
   ============================================
   + Hits           8998     9021      +23     
   - Misses         5006     5011       +5     
   - Partials        764      767       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `78.12% <85.71%> (+2.26%)` | :arrow_up: |
   | [...org/apache/kyuubi/ha/client/ServiceDiscovery.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL2NsaWVudC9TZXJ2aWNlRGlzY292ZXJ5LnNjYWxh) | `89.28% <0.00%> (-3.58%)` | :arrow_down: |
   | [...rg/apache/kyuubi/engine/trino/TrinoStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdGVtZW50LnNjYWxh) | `67.46% <0.00%> (-2.41%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.27% <0.00%> (-0.15%)` | :arrow_down: |
   | [...che/kyuubi/engine/trino/operation/GetColumns.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9HZXRDb2x1bW5zLnNjYWxh) | `88.88% <0.00%> (ø)` | |
   | [...engine/trino/operation/TrinoOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9Ucmlub09wZXJhdGlvbk1hbmFnZXIuc2NhbGE=) | `90.00% <0.00%> (+5.78%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [2501f9a...45bc05f](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042653631


   @iodone, could you please add the test case for this change and skip the plan parsing of `UseStatement` in Flink engine?
   cc @yaooqinn


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] iodone commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
iodone commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r808961190



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {

Review comment:
       Of course it is possible, here is just my personal scala programming preference, try to avoid dealing with `null`, and not to produce `null`. Is it sure that the wrapping of Option needs to be removed here?




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809711933



##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatementSuite.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.operation
+
+import java.sql.SQLException
+
+import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
+
+class PlanOnlyStatementSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {

Review comment:
       can you address this comment too @iodone




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] iodone commented on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
iodone commented on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1046386143


   > @iodone, I left the minor comments. Please help to address.
   
   Very nice, I will immediately correct


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0440e3) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/2501f9ad8348086b7b3ef2d65e378c24843ed224?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2501f9a) will **decrease** coverage by `0.02%`.
   > The diff coverage is `57.14%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   - Coverage     60.92%   60.90%   -0.03%     
     Complexity       72       72              
   ============================================
     Files           303      303              
     Lines         14768    14771       +3     
     Branches       1902     1904       +2     
   ============================================
   - Hits           8998     8996       -2     
   - Misses         5006     5007       +1     
   - Partials        764      768       +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `71.87% <57.14%> (-3.99%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...n/scala/org/apache/kyuubi/KyuubiSQLException.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9LeXV1YmlTUUxFeGNlcHRpb24uc2NhbGE=) | `92.77% <0.00%> (-1.21%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.27% <0.00%> (-0.15%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [2501f9a...f0440e3](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809608004



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {
+    case Some(res) if res.isEmpty =>
+      new StructType().add("Result", "string")
+    case Some(res) =>
+      res.schema
+    case _ =>
       new StructType().add("plan", "string")
-    } else {
-      result.schema
-    }
+  }
 
-  private def isSetOrReset(plan: LogicalPlan): Boolean = {
+  private def shouldDirectRun(plan: LogicalPlan): Boolean = {
     val className = plan.getClass.getSimpleName
-    className == "SetCommand" || className == "ResetCommand"
+    className == "SetCommand" || className == "ResetCommand" || className == "UseStatement"

Review comment:
       it has migrated to `SetNamespaceCommand`, see https://github.com/apache/spark/pull/34127




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809625834



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {
+    case Some(res) if res.isEmpty =>
+      new StructType().add("Result", "string")
+    case Some(res) =>
+      res.schema
+    case _ =>
       new StructType().add("plan", "string")
-    } else {
-      result.schema
-    }
+  }
 
-  private def isSetOrReset(plan: LogicalPlan): Boolean = {
+  private def shouldDirectRun(plan: LogicalPlan): Boolean = {
     val className = plan.getClass.getSimpleName
-    className == "SetCommand" || className == "ResetCommand"
+    className == "SetCommand" || className == "ResetCommand" || className == "UseStatement"

Review comment:
       > h migrate `UseStatement` to v2 command framework and change it to `SetNamespaceCommand`, But Spark 3.1 and 3.2 still have `UseStatement`. Do our changes here need to be forward compatible like Spark 3.3?
   
   @iodone, IMO, for compatibility, you could check whether the Spark version has the `UseStatement`. If no, use the `SetNamespaceCommand`. 




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809636067



##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatementSuite.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.operation
+
+import java.sql.SQLException
+
+import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
+
+class PlanOnlyStatementSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {

Review comment:
       @cfmcgrady, I have mentioned above for this change.




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn commented on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1043997831


   LGTM, only minor comments at https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809711933


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn closed pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn closed pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921


   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r808947996



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {

Review comment:
       can we avoid creating an Option here?




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] cfmcgrady commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
cfmcgrady commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809627701



##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatementSuite.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.operation
+
+import java.sql.SQLException
+
+import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
+
+class PlanOnlyStatementSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {

Review comment:
       We have several unit tests of executing queries in PlanOnly mode for the spark engine, see https://github.com/apache/incubator-kyuubi/blob/6403224199d8cedcad9c8e0d98e2ff8be14c7062/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala#L23 I think we should put all of the existing Spark engine's unit tests together, cc @yaooqinn 
   




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809625834



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {
+    case Some(res) if res.isEmpty =>
+      new StructType().add("Result", "string")
+    case Some(res) =>
+      res.schema
+    case _ =>
       new StructType().add("plan", "string")
-    } else {
-      result.schema
-    }
+  }
 
-  private def isSetOrReset(plan: LogicalPlan): Boolean = {
+  private def shouldDirectRun(plan: LogicalPlan): Boolean = {
     val className = plan.getClass.getSimpleName
-    className == "SetCommand" || className == "ResetCommand"
+    className == "SetCommand" || className == "ResetCommand" || className == "UseStatement"

Review comment:
       > h migrate `UseStatement` to v2 command framework and change it to `SetNamespaceCommand`, But Spark 3.1 and 3.2 still have `UseStatement`. Do our changes here need to be forward compatible like Spark 3.3?
   
   IMO, for compatibility, you could check whether the Spark version has the `UseStatement`. If no, use the `SetNamespaceCommand`. 




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] iodone commented on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
iodone commented on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042660241


   > @iodone, could you please add the test case for this change and skip the plan parsing of `UseStatement` in Flink engine? cc @yaooqinn
   
   No problem


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (70ce8de) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/74abe8510c3a01283e52d8ba59a7fe350e42434e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (74abe85) will **increase** coverage by `0.07%`.
   > The diff coverage is `25.00%`.
   
   > :exclamation: Current head 70ce8de differs from pull request most recent head 79d7ba6. Consider uploading reports for the commit 79d7ba6 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   + Coverage     60.86%   60.94%   +0.07%     
   - Complexity       69       72       +3     
   ============================================
     Files           302      304       +2     
     Lines         14797    14824      +27     
     Branches       1915     1919       +4     
   ============================================
   + Hits           9006     9034      +28     
   + Misses         5023     5016       -7     
   - Partials        768      774       +6     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `55.00% <25.00%> (-7.86%)` | :arrow_down: |
   | [.../kyuubi/sql/zorder/OptimizeZorderCommandBase.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstY29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC96b3JkZXIvT3B0aW1pemVab3JkZXJDb21tYW5kQmFzZS5zY2FsYQ==) | `77.27% <0.00%> (-4.55%)` | :arrow_down: |
   | [...ache/kyuubi/operation/KyuubiOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uTWFuYWdlci5zY2FsYQ==) | `92.50% <0.00%> (-2.50%)` | :arrow_down: |
   | [...cala/org/apache/kyuubi/sql/zorder/ZorderBase.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstY29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC96b3JkZXIvWm9yZGVyQmFzZS5zY2FsYQ==) | `85.00% <0.00%> (-2.50%)` | :arrow_down: |
   | [...n/scala/org/apache/kyuubi/KyuubiSQLException.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9LeXV1YmlTUUxFeGNlcHRpb24uc2NhbGE=) | `92.77% <0.00%> (-1.21%)` | :arrow_down: |
   | [.../org/apache/kyuubi/jdbc/hive/KyuubiConnection.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhpdmUtamRiYy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUva3l1dWJpL2pkYmMvaGl2ZS9LeXV1YmlDb25uZWN0aW9uLmphdmE=) | `4.28% <0.00%> (-0.09%)` | :arrow_down: |
   | [.../apache/hive/beeline/KyuubiDatabaseConnection.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhpdmUtYmVlbGluZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaGl2ZS9iZWVsaW5lL0t5dXViaURhdGFiYXNlQ29ubmVjdGlvbi5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...yuubi/sql/zorder/OptimizeZorderStatementBase.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstY29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC96b3JkZXIvT3B0aW1pemVab3JkZXJTdGF0ZW1lbnRCYXNlLnNjYWxh) | `71.42% <0.00%> (ø)` | |
   | [...org/apache/kyuubi/sql/RebalanceBeforeWriting.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstMy0yL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9SZWJhbGFuY2VCZWZvcmVXcml0aW5nLnNjYWxh) | | |
   | [...sqlclassification/KyuubiGetSqlClassification.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstMy0xL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9zcWxjbGFzc2lmaWNhdGlvbi9LeXV1YmlHZXRTcWxDbGFzc2lmaWNhdGlvbi5zY2FsYQ==) | `76.47% <0.00%> (ø)` | |
   | ... and [4 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9b42537...79d7ba6](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r810473290



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,27 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
+  override protected def resultSchema: StructType = {
     if (result == null) {
       new StructType().add("plan", "string")
-    } else {
-      result.schema
-    }
+    } else if (result.isEmpty) {
+      new StructType().add("Result", "string")

Review comment:
       ```suggestion
         new StructType().add("result", "string")
   ```




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn commented on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1047391023


   can you check the test failure?
   
   ```
   KYUUBI #1920: Plan only operations with CacheTableCommand skiped *** FAILED ***
   ```


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] iodone commented on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
iodone commented on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042783225


   hi @SteNicholas,  I reviewed the implementation of planOnly in flink and found that only `parse` mode is implemented, the skip of the use statement is only practical for the phase after analyzer, so there is no need to implement this feature in flink at the moment. Therefore, only the relevant tests of spark are added case.
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r808980110



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {

Review comment:
       we can remove changes here




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809614550



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {
+    case Some(res) if res.isEmpty =>
+      new StructType().add("Result", "string")
+    case Some(res) =>
+      res.schema
+    case _ =>
       new StructType().add("plan", "string")
-    } else {
-      result.schema
-    }
+  }
 
-  private def isSetOrReset(plan: LogicalPlan): Boolean = {
+  private def shouldDirectRun(plan: LogicalPlan): Boolean = {
     val className = plan.getClass.getSimpleName
-    className == "SetCommand" || className == "ResetCommand"
+    className == "SetCommand" || className == "ResetCommand" || className == "UseStatement"

Review comment:
       @iodone , in spark 3.0, `UseStatement` is replaced with `SetNamespaceCommand`, which changes in [https://github.com/apache/spark/pull/34127](https://github.com/apache/spark/pull/34127).




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b546c87) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/6403224199d8cedcad9c8e0d98e2ff8be14c7062?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6403224) will **decrease** coverage by `0.03%`.
   > The diff coverage is `85.71%`.
   
   > :exclamation: Current head b546c87 differs from pull request most recent head d759b03. Consider uploading reports for the commit d759b03 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   - Coverage     60.99%   60.95%   -0.04%     
     Complexity       72       72              
   ============================================
     Files           304      304              
     Lines         14798    14799       +1     
     Branches       1909     1910       +1     
   ============================================
   - Hits           9026     9021       -5     
   - Misses         5006     5011       +5     
   - Partials        766      767       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `78.12% <85.71%> (+2.26%)` | :arrow_up: |
   | [...engine/trino/operation/TrinoOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9Ucmlub09wZXJhdGlvbk1hbmFnZXIuc2NhbGE=) | `90.00% <0.00%> (-5.00%)` | :arrow_down: |
   | [...org/apache/kyuubi/ha/client/ServiceDiscovery.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL2NsaWVudC9TZXJ2aWNlRGlzY292ZXJ5LnNjYWxh) | `89.28% <0.00%> (-3.58%)` | :arrow_down: |
   | [...rg/apache/kyuubi/engine/trino/TrinoStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdGVtZW50LnNjYWxh) | `67.46% <0.00%> (-2.41%)` | :arrow_down: |
   | [...kyuubi/engine/trino/operation/TrinoOperation.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9Ucmlub09wZXJhdGlvbi5zY2FsYQ==) | `49.01% <0.00%> (-1.93%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.27% <0.00%> (-0.15%)` | :arrow_down: |
   | [...g/apache/kyuubi/engine/flink/result/Constants.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL3Jlc3VsdC9Db25zdGFudHMuamF2YQ==) | `50.00% <0.00%> (ø)` | |
   | [...n/scala/org/apache/kyuubi/KyuubiSQLException.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9LeXV1YmlTUUxFeGNlcHRpb24uc2NhbGE=) | `93.97% <0.00%> (+1.20%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [6403224...d759b03](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1043864959


   @iodone, you could rebase origin master, not merge the master branch.


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r810473133



##########
File path: kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala
##########
@@ -79,6 +79,19 @@ class PlanOnlyOperationSuite extends WithKyuubiServer with HiveJDBCTestHelper {
     }
   }
 
+  test("KYUUBI #1920: Plan only operations with skip Usestatement or SetNamespaceCommand") {
+    val createDatabaseStatement = "create database test_database"
+    val useStatement = "use test_database"
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY.key -> NONE.toString))(Map.empty) {
+      withDatabases("test_database") { statement =>
+        statement.execute(createDatabaseStatement)
+        statement.execute(s"set ${KyuubiConf.OPERATION_PLAN_ONLY.key}=optimize")
+        val result = statement.executeQuery(useStatement)

Review comment:
       ```suggestion
           val result = statement.executeQuery("use test_database")
   ```




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809626469



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {
+    case Some(res) if res.isEmpty =>
+      new StructType().add("Result", "string")
+    case Some(res) =>
+      res.schema
+    case _ =>
       new StructType().add("plan", "string")
-    } else {
-      result.schema
-    }
+  }
 
-  private def isSetOrReset(plan: LogicalPlan): Boolean = {
+  private def shouldDirectRun(plan: LogicalPlan): Boolean = {
     val className = plan.getClass.getSimpleName
-    className == "SetCommand" || className == "ResetCommand"
+    className == "SetCommand" || className == "ResetCommand" || className == "UseStatement"

Review comment:
       we can match them all in this PR, we have a daily flow to check compatibility for spark master




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn commented on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1047555487


   @iodone @SteNicholas @ulysses-you @cfmcgrady thanks, merged to master 


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] iodone commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
iodone commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r811740636



##########
File path: kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala
##########
@@ -79,6 +79,35 @@ class PlanOnlyOperationSuite extends WithKyuubiServer with HiveJDBCTestHelper {
     }
   }
 
+  test("KYUUBI #1920: Plan only operations with Usestatement or SetNamespaceCommand skiped") {
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY.key -> NONE.toString))(Map.empty) {
+      withDatabases("test_database") { statement =>
+        statement.execute("create database test_database")
+        statement.execute(s"set ${KyuubiConf.OPERATION_PLAN_ONLY.key}=optimize")
+        val result = statement.executeQuery("use test_database")
+        assert(!result.next(), "In contrast to PlanOnly mode, it will returns an empty result")
+      }
+    }
+  }
+
+  test("KYUUBI #1920: Plan only operations with CacheTable skiped") {
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY.key -> OPTIMIZE.toString))(Map.empty) {
+      withJdbcStatement() { statement =>
+        val result = statement.executeQuery("cache table cached_table as select 1")
+        assert(!result.next(), "In contrast to PlanOnly mode, it will returns an empty result")
+      }
+    }
+  }
+
+  test("KYUUBI #1920: Plan only operations with CreateViewStatement or CreateViewCommand skiped") {
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY.key -> OPTIMIZE.toString))(Map.empty) {
+      withJdbcStatement() { statement =>
+        val result = statement.executeQuery("create temp view temp_view as select 1")

Review comment:
       OK, https://github.com/apache/incubator-kyuubi/issues/1920#issuecomment-1046736582 suggested that will create a new issue with address this problem




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0440e3) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/2501f9ad8348086b7b3ef2d65e378c24843ed224?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2501f9a) will **decrease** coverage by `0.02%`.
   > The diff coverage is `57.14%`.
   
   > :exclamation: Current head f0440e3 differs from pull request most recent head a8c93f4. Consider uploading reports for the commit a8c93f4 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   - Coverage     60.92%   60.90%   -0.03%     
     Complexity       72       72              
   ============================================
     Files           303      303              
     Lines         14768    14771       +3     
     Branches       1902     1904       +2     
   ============================================
   - Hits           8998     8996       -2     
   - Misses         5006     5007       +1     
   - Partials        764      768       +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `71.87% <57.14%> (-3.99%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...n/scala/org/apache/kyuubi/KyuubiSQLException.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9LeXV1YmlTUUxFeGNlcHRpb24uc2NhbGE=) | `92.77% <0.00%> (-1.21%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.27% <0.00%> (-0.15%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [2501f9a...a8c93f4](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809625751



##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatementSuite.scala
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.operation
+
+import java.sql.SQLException
+
+import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
+
+class PlanOnlyStatementSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
+  override protected def jdbcUrl: String = getJdbcUrl
+  override def withKyuubiConf: Map[String, String] = Map.empty
+
+  test("Plan only operations - skip use statement") {
+    val createDatabaseStatement = "create database test_database"
+    val createTableStatement = "create table test_database.t(a int) using parquet"
+    val selectStatement = "select * from t"
+    val useStatement = "use test_database"
+    withJdbcStatement("t") { statement =>
+      statement.executeQuery(createDatabaseStatement)
+      statement.executeQuery(createTableStatement)
+
+      statement.execute("SET kyuubi.operation.plan.only.mode=parse")
+      val set0 = statement.executeQuery(selectStatement)
+      assert(set0.next())
+      assert(set0.getString("plan") contains "UnresolvedRelation")
+
+      statement.execute("SET kyuubi.operation.plan.only.mode=optimize")
+      val e0 = intercept[SQLException](statement.executeQuery(selectStatement))
+      assert(e0.getMessage.contains("Table or view not found"))
+
+      // execute UseStatement with plan-only mode to switch current database to 'test_database'
+      statement.executeQuery(useStatement)

Review comment:
       Instead of checking the side-effect to other queries, we can test `use statement` and check the result directly to make the test simple.




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#discussion_r809614550



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
##########
@@ -38,23 +38,25 @@ class PlanOnlyStatement(
   private val operationLog: OperationLog = OperationLog.createOperationLog(session, getHandle)
   override def getOperationLog: Option[OperationLog] = Option(operationLog)
 
-  override protected def resultSchema: StructType =
-    if (result == null) {
+  override protected def resultSchema: StructType = Option(result) match {
+    case Some(res) if res.isEmpty =>
+      new StructType().add("Result", "string")
+    case Some(res) =>
+      res.schema
+    case _ =>
       new StructType().add("plan", "string")
-    } else {
-      result.schema
-    }
+  }
 
-  private def isSetOrReset(plan: LogicalPlan): Boolean = {
+  private def shouldDirectRun(plan: LogicalPlan): Boolean = {
     val className = plan.getClass.getSimpleName
-    className == "SetCommand" || className == "ResetCommand"
+    className == "SetCommand" || className == "ResetCommand" || className == "UseStatement"

Review comment:
       @iodone , in spark 3.0, `UseStatement` is replaced with `SetNamespaceCommand`, which changes in [https://github.com/apache/spark/pull/34127](https://github.com/apache/spark/pull/34127).




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b546c87) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/2501f9ad8348086b7b3ef2d65e378c24843ed224?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2501f9a) will **increase** coverage by `0.02%`.
   > The diff coverage is `85.71%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   + Coverage     60.92%   60.95%   +0.02%     
     Complexity       72       72              
   ============================================
     Files           303      304       +1     
     Lines         14768    14799      +31     
     Branches       1902     1910       +8     
   ============================================
   + Hits           8998     9021      +23     
   - Misses         5006     5011       +5     
   - Partials        764      767       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `78.12% <85.71%> (+2.26%)` | :arrow_up: |
   | [...org/apache/kyuubi/ha/client/ServiceDiscovery.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL2NsaWVudC9TZXJ2aWNlRGlzY292ZXJ5LnNjYWxh) | `89.28% <0.00%> (-3.58%)` | :arrow_down: |
   | [...rg/apache/kyuubi/engine/trino/TrinoStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdGVtZW50LnNjYWxh) | `67.46% <0.00%> (-2.41%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.27% <0.00%> (-0.15%)` | :arrow_down: |
   | [...che/kyuubi/engine/trino/operation/GetColumns.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9HZXRDb2x1bW5zLnNjYWxh) | `88.88% <0.00%> (ø)` | |
   | [...engine/trino/operation/TrinoOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9Ucmlub09wZXJhdGlvbk1hbmFnZXIuc2NhbGE=) | `90.00% <0.00%> (+5.78%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [2501f9a...b546c87](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b546c87) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/2501f9ad8348086b7b3ef2d65e378c24843ed224?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2501f9a) will **increase** coverage by `0.02%`.
   > The diff coverage is `85.71%`.
   
   > :exclamation: Current head b546c87 differs from pull request most recent head ec46431. Consider uploading reports for the commit ec46431 to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   + Coverage     60.92%   60.95%   +0.02%     
     Complexity       72       72              
   ============================================
     Files           303      304       +1     
     Lines         14768    14799      +31     
     Branches       1902     1910       +8     
   ============================================
   + Hits           8998     9021      +23     
   - Misses         5006     5011       +5     
   - Partials        764      767       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `78.12% <85.71%> (+2.26%)` | :arrow_up: |
   | [...org/apache/kyuubi/ha/client/ServiceDiscovery.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL2NsaWVudC9TZXJ2aWNlRGlzY292ZXJ5LnNjYWxh) | `89.28% <0.00%> (-3.58%)` | :arrow_down: |
   | [...rg/apache/kyuubi/engine/trino/TrinoStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdGVtZW50LnNjYWxh) | `67.46% <0.00%> (-2.41%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.27% <0.00%> (-0.15%)` | :arrow_down: |
   | [...che/kyuubi/engine/trino/operation/GetColumns.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9HZXRDb2x1bW5zLnNjYWxh) | `88.88% <0.00%> (ø)` | |
   | [...engine/trino/operation/TrinoOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9Ucmlub09wZXJhdGlvbk1hbmFnZXIuc2NhbGE=) | `90.00% <0.00%> (+5.78%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [2501f9a...ec46431](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] SteNicholas commented on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042653631


   @iodone, could you please add the test case for this change?


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1921: [KYUUBI #1920] Skip the Plan parsing of UseStatement

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1921:
URL: https://github.com/apache/incubator-kyuubi/pull/1921#issuecomment-1042670905


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1921](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b546c87) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/6403224199d8cedcad9c8e0d98e2ff8be14c7062?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6403224) will **decrease** coverage by `0.03%`.
   > The diff coverage is `85.71%`.
   
   > :exclamation: Current head b546c87 differs from pull request most recent head 6069ccb. Consider uploading reports for the commit 6069ccb to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1921      +/-   ##
   ============================================
   - Coverage     60.99%   60.95%   -0.04%     
     Complexity       72       72              
   ============================================
     Files           304      304              
     Lines         14798    14799       +1     
     Branches       1909     1910       +1     
   ============================================
   - Hits           9026     9021       -5     
   - Misses         5006     5011       +5     
   - Partials        766      767       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ubi/engine/spark/operation/PlanOnlyStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vUGxhbk9ubHlTdGF0ZW1lbnQuc2NhbGE=) | `78.12% <85.71%> (+2.26%)` | :arrow_up: |
   | [...engine/trino/operation/TrinoOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9Ucmlub09wZXJhdGlvbk1hbmFnZXIuc2NhbGE=) | `90.00% <0.00%> (-5.00%)` | :arrow_down: |
   | [...org/apache/kyuubi/ha/client/ServiceDiscovery.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL2NsaWVudC9TZXJ2aWNlRGlzY292ZXJ5LnNjYWxh) | `89.28% <0.00%> (-3.58%)` | :arrow_down: |
   | [...rg/apache/kyuubi/engine/trino/TrinoStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdGVtZW50LnNjYWxh) | `67.46% <0.00%> (-2.41%)` | :arrow_down: |
   | [...kyuubi/engine/trino/operation/TrinoOperation.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9Ucmlub09wZXJhdGlvbi5zY2FsYQ==) | `49.01% <0.00%> (-1.93%)` | :arrow_down: |
   | [...mon/src/main/scala/org/apache/kyuubi/Logging.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9Mb2dnaW5nLnNjYWxh) | `39.72% <0.00%> (-1.37%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `96.27% <0.00%> (-0.15%)` | :arrow_down: |
   | [...g/apache/kyuubi/engine/flink/result/Constants.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1mbGluay1zcWwtZW5naW5lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL2ZsaW5rL3Jlc3VsdC9Db25zdGFudHMuamF2YQ==) | `50.00% <0.00%> (ø)` | |
   | [...n/scala/org/apache/kyuubi/KyuubiSQLException.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9LeXV1YmlTUUxFeGNlcHRpb24uc2NhbGE=) | `93.97% <0.00%> (+1.20%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [6403224...6069ccb](https://codecov.io/gh/apache/incubator-kyuubi/pull/1921?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org