lihaosky commented on code in PR #28385:
URL: https://github.com/apache/flink/pull/28385#discussion_r3410949836


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/operations/SqlDdlToOperationConverterTest.java:
##########
@@ -658,6 +660,31 @@ void testCreateTableValidDistribution() {
                                                         
Collections.singletonList("a"), null)))));
     }
 
+    @Test
+    void testCreateTableWithConnection() {
+        final String sql =
+                "create table derivedTable(\n"
+                        + "  a int\n"
+                        + ")\n"
+                        + "USING CONNECTION mycat.mydb.myconn";
+        Operation operation = parseAndConvert(sql);

Review Comment:
   Good catch — uppercased the keywords (`CREATE TABLE`, `INT`) in both tests.



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/operations/SqlDdlToOperationConverterTest.java:
##########
@@ -658,6 +660,31 @@ void testCreateTableValidDistribution() {
                                                         
Collections.singletonList("a"), null)))));
     }
 
+    @Test
+    void testCreateTableWithConnection() {
+        final String sql =
+                "create table derivedTable(\n"
+                        + "  a int\n"
+                        + ")\n"
+                        + "USING CONNECTION mycat.mydb.myconn";
+        Operation operation = parseAndConvert(sql);
+        assertThat(operation)
+                .is(
+                        new HamcrestCondition<>(
+                                isCreateTableOperation(
+                                        withConnection(
+                                                UnresolvedIdentifier.of(
+                                                        "mycat", "mydb", 
"myconn")))));
+    }
+
+    @Test
+    void testCreateTableWithoutConnection() {
+        final String sql = "create table derivedTable(\n" + "  a int\n" + ")";
+        Operation operation = parseAndConvert(sql);
+        assertThat(operation)
+                .is(new 
HamcrestCondition<>(isCreateTableOperation(withConnection(null))));

Review Comment:
   Removed `HamcrestCondition` here — the tests now cast to 
`CreateTableOperation` and assert on `getCatalogTable().getConnection()` 
directly with AssertJ. Also dropped the now-unused `withConnection` matcher 
from `OperationMatchers`.



-- 
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