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

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


Reply via email to