jnh5y commented on code in PR #21133:
URL: https://github.com/apache/flink/pull/21133#discussion_r1023336995


##########
flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/SqlGatewayServiceITCase.java:
##########
@@ -157,6 +169,80 @@ public void testOpenSessionWithEnvironment() throws 
Exception {
         assertThat(tableEnv.listModules()).contains(moduleName);
     }
 
+    @Test
+    public void testConfigureSessionWithLegalStatement(@TempDir 
java.nio.file.Path tmpDir)
+            throws Exception {
+        SessionHandle sessionHandle = 
service.openSession(defaultSessionEnvironment);
+
+        // SET & RESET
+        verifyConfigureSession(sessionHandle, "SET 'key1' = 'value1';");
+        Map<String, String> config = new HashMap<>();
+        config.put("key1", "value1");
+        
assertThat(service.getSessionConfig(sessionHandle)).containsAllEntriesOf(config);
+
+        verifyConfigureSession(sessionHandle, "RESET 'key1';");
+        
assertThat(service.getSessionConfig(sessionHandle)).doesNotContainEntry("key1", 
"value1");
+
+        // CREATE & USE & ALTER & DROP
+        verifyConfigureSession(
+                sessionHandle,
+                "CREATE CATALOG mycat with ('type' = 'generic_in_memory', 
'default-database' = 'db');");
+
+        verifyConfigureSession(sessionHandle, "USE CATALOG mycat;");
+        
assertThat(service.getCurrentCatalog(sessionHandle)).isEqualTo("mycat");

Review Comment:
   Makes sense!
   



-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to