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

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


Reply via email to