You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ya...@apache.org on 2022/08/29 03:19:49 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #3357]Improve doc description for configuration `kyuubi.operation.plan.only.mode`

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8f57c431b [KYUUBI #3357]Improve doc description for configuration `kyuubi.operation.plan.only.mode`
8f57c431b is described below

commit 8f57c431b81a8b34d09599f96d4fe62a3e228590
Author: yikf <yi...@gmail.com>
AuthorDate: Mon Aug 29 11:19:40 2022 +0800

    [KYUUBI #3357]Improve doc description for configuration `kyuubi.operation.plan.only.mode`
    
    ### _Why are the changes needed?_
    
    Fix https://github.com/apache/incubator-kyuubi/issues/3357
    This pr aims to improve doc description for configuration kyuubi.operation.plan.only.mode
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #3358 from Yikf/planOnly-doc.
    
    Closes #3357
    
    571f4e0c [yikf] Improve doc description for configuration `kyuubi.operation.plan.only.mode`
    
    Authored-by: yikf <yi...@gmail.com>
    Signed-off-by: Kent Yao <ya...@apache.org>
---
 docs/deployment/settings.md                               |  2 +-
 .../kyuubi/engine/spark/operation/PlanOnlyStatement.scala |  2 +-
 .../main/scala/org/apache/kyuubi/config/KyuubiConf.scala  | 15 +++++++++++----
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/docs/deployment/settings.md b/docs/deployment/settings.md
index 51e0ca98e..cee7e7204 100644
--- a/docs/deployment/settings.md
+++ b/docs/deployment/settings.md
@@ -406,7 +406,7 @@ kyuubi.operation.interrupt.on.cancel|true|When true, all running tasks will be i
 kyuubi.operation.language|SQL|Choose a programing language for the following inputs <ul><li>SQL: (Default) Run all following statements as SQL queries.</li> <li>SCALA: Run all following input a scala codes</li></ul>|string|1.5.0
 kyuubi.operation.log.dir.root|server_operation_logs|Root directory for query operation log at server-side.|string|1.4.0
 kyuubi.operation.plan.only.excludes|ResetCommand,SetCommand,SetNamespaceCommand,UseStatement,SetCatalogAndNamespace|Comma-separated list of query plan names, in the form of simple class names, i.e, for `set abc=xyz`, the value will be `SetCommand`. For those auxiliary plans, such as `switch databases`, `set properties`, or `create temporary view` e.t.c, which are used for setup evaluating environments for analyzing actual queries, we can use this config to exclude them and let them take  [...]
-kyuubi.operation.plan.only.mode|NONE|Whether to perform the statement in a PARSE, ANALYZE, OPTIMIZE, OPTIMIZE_WITH_STATS, PHYSICAL, EXECUTION only way without executing the query. When it is NONE, the statement will be fully executed|string|1.4.0
+kyuubi.operation.plan.only.mode|NONE|Configures the statement performed mode, The value can be 'parse', 'analyze', 'optimize', 'optimize_with_stats', 'physical', 'execution', or 'none', when it is 'none', indicate to the statement will be fully executed, otherwise only way without executing the query. different engines currently support different modes, the Spark engine supports all modes, and the Flink engine supports 'parse', 'physical', and 'execution', other engines do not support pl [...]
 kyuubi.operation.progress.enabled|false|Whether to enable the operation progress. When true, the operation progress will be returned in `GetOperationStatus`.|boolean|1.6.0
 kyuubi.operation.query.timeout|&lt;undefined&gt;|Timeout for query executions at server-side, take affect with client-side timeout(`java.sql.Statement.setQueryTimeout`) together, a running query will be cancelled automatically if timeout. It's off by default, which means only client-side take fully control whether the query should timeout or not. If set, client-side timeout capped at this point. To cancel the queries right away without waiting task to finish, consider enabling kyuubi.ope [...]
 kyuubi.operation.result.max.rows|0|Max rows of Spark query results. Rows that exceeds the limit would be ignored. By setting this value to 0 to disable the max rows limit.|int|1.6.0
diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
index a3d6fda85..ec36e5204 100644
--- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
+++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/PlanOnlyStatement.scala
@@ -88,7 +88,7 @@ class PlanOnlyStatement(
               case EXECUTION =>
                 val executed = spark.sql(statement).queryExecution.executedPlan
                 iter = new IterableFetchIterator(Seq(Row(executed.toString())))
-              case UNKNOWN =>
+              case _ =>
                 throw KyuubiSQLException(s"The operation mode $mode" +
                   " doesn't support in Spark SQL engine.")
             }
diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
index 008fdbe93..0a7e1f35f 100644
--- a/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
+++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
@@ -1659,13 +1659,20 @@ object KyuubiConf {
 
   val OPERATION_PLAN_ONLY_MODE: ConfigEntry[String] =
     buildConf("kyuubi.operation.plan.only.mode")
-      .doc("Whether to perform the statement in a PARSE, ANALYZE, OPTIMIZE, OPTIMIZE_WITH_STATS," +
-        " PHYSICAL, EXECUTION only way without executing the query. When it is NONE, " +
-        "the statement will be fully executed")
+      .doc("Configures the statement performed mode, The value can be 'parse', 'analyze', " +
+        "'optimize', 'optimize_with_stats', 'physical', 'execution', or 'none', " +
+        "when it is 'none', indicate to the statement will be fully executed, otherwise " +
+        "only way without executing the query. different engines currently support different " +
+        "modes, the Spark engine supports all modes, and the Flink engine supports 'parse', " +
+        "'physical', and 'execution', other engines do not support planOnly currently.")
       .version("1.4.0")
       .stringConf
       .transform(_.toUpperCase(Locale.ROOT))
-      .checkValues(OperationModes.values.map(_.toString))
+      .checkValue(
+        mode => OperationModes.values.map(_.toString).contains(mode),
+        "Invalid value for 'kyuubi.operation.plan.only.mode'. Valid values are" +
+          "'parse', 'analyze', 'optimize', 'optimize_with_stats', 'physical', 'execution' " +
+          "and 'none'.")
       .createWithDefault(OperationModes.NONE.toString)
 
   val OPERATION_PLAN_ONLY_EXCLUDES: ConfigEntry[Seq[String]] =