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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to