You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/08/11 07:16:37 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3216: [KYUUBI #3214] Plan only mode should unset when mode value is incorrect

yaooqinn commented on code in PR #3216:
URL: https://github.com/apache/incubator-kyuubi/pull/3216#discussion_r943158929


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala:
##########
@@ -114,6 +114,24 @@ class PlanOnlyOperationSuite extends WithKyuubiServer with HiveJDBCTestHelper {
     }
   }
 
+  test("kyuubi #3214: Plan only mode with an incorrect value") {
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY_MODE.key -> "parse"))(Map.empty) {
+      withJdbcStatement() { statement =>
+        statement.executeQuery(s"set ${KyuubiConf.OPERATION_PLAN_ONLY_MODE.key}=parser")
+        try {
+          statement.executeQuery("select 1")
+        } catch {
+          case e: Exception =>

Review Comment:
   use intercept instead of try-catch



##########
kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala:
##########
@@ -114,6 +114,24 @@ class PlanOnlyOperationSuite extends WithKyuubiServer with HiveJDBCTestHelper {
     }
   }
 
+  test("kyuubi #3214: Plan only mode with an incorrect value") {
+    withSessionConf()(Map(KyuubiConf.OPERATION_PLAN_ONLY_MODE.key -> "parse"))(Map.empty) {
+      withJdbcStatement() { statement =>
+        statement.executeQuery(s"set ${KyuubiConf.OPERATION_PLAN_ONLY_MODE.key}=parser")
+        try {
+          statement.executeQuery("select 1")
+        } catch {
+          case e: Exception =>
+            assert(e.getMessage.contains("The operation mode UNKNOWN doesn't support"))
+        }
+        statement.executeQuery(s"set ${KyuubiConf.OPERATION_PLAN_ONLY_MODE.key}=parse")

Review Comment:
   this test works because of `kyuubi.operation.plan.only.excludes`.
   
   So this is actually a side-effect and indeterministic.



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org