You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/12/09 02:57:25 UTC

[GitHub] [flink] fsk119 commented on a diff in pull request #21141: [FLINK-29742][sql-gateway] Support completing statement in SqlGatewayService.

fsk119 commented on code in PR #21141:
URL: https://github.com/apache/flink/pull/21141#discussion_r1044047364


##########
flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/SqlGatewayServiceITCase.java:
##########
@@ -554,6 +554,55 @@ public void testListUserDefinedFunctions() {
                                                 "table_func0"))));
     }
 
+    @Test
+    public void testCompleteStatement() throws Exception {
+        SessionHandle sessionHandle = service.openSession(defaultSessionEnvironment);
+
+        String createTable1 =
+                "CREATE TABLE Table1 (\n"
+                        + "  IntegerField1 INT,\n"
+                        + "  StringField1 STRING,\n"
+                        + "  TimestampField1 TIMESTAMP(3)\n"
+                        + ") WITH (\n"
+                        + "  'connector' = 'datagen'\n"
+                        + ")\n";
+        String createTable2 =
+                "CREATE TABLE Table2 (\n"
+                        + "  BooleanField BOOLEAN,\n"
+                        + "  StringField2 STRING,\n"
+                        + "  TimestampField2 TIMESTAMP\n"
+                        + ") WITH (\n"
+                        + "  'connector' = 'blackhole'\n"
+                        + ")\n";
+
+        service.getSession(sessionHandle)
+                .createExecutor()
+                .getTableEnvironment()
+                .executeSql(createTable1);
+        service.getSession(sessionHandle)
+                .createExecutor()
+                .getTableEnvironment()
+                .executeSql(createTable2);
+
+        List<String> expectedTableHints =
+                Arrays.asList(
+                        "default_catalog.default_database.Table1",
+                        "default_catalog.default_database.Table2");
+        String incompleteSql = "SELECT * FROM Ta";

Review Comment:
   I think we can inline incompleteSql and expectedTableHints.



-- 
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-unsubscribe@flink.apache.org

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