snuyanzin commented on code in PR #28385:
URL: https://github.com/apache/flink/pull/28385#discussion_r3409372221
##########
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:
why do we need `HamcrestCondition` here and can't live without it?
--
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]