raminqaf commented on code in PR #27844:
URL: https://github.com/apache/flink/pull/27844#discussion_r3014999181
##########
flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/api/internal/ShowCreateUtilTest.java:
##########
@@ -124,8 +124,19 @@ void showCreateMaterializedTable(
materializedTable,
MATERIALIZED_TABLE_IDENTIFIER,
false,
+ false,
DefaultSqlFactory.INSTANCE);
assertThat(createMaterializedTableString).isEqualTo(expected);
+
+ final String createOrAlterMaterializedTableString =
+ ShowCreateUtil.buildShowCreateMaterializedTableRow(
+ materializedTable,
+ MATERIALIZED_TABLE_IDENTIFIER,
+ false,
+ true,
+ DefaultSqlFactory.INSTANCE);
+ assertThat(createOrAlterMaterializedTableString)
+ .isEqualTo(expected.replaceFirst("CREATE ", "CREATE OR ALTER
"));
}
Review Comment:
The method `argsForShowCreateMaterializedTable` calls
`addCreateAndCreateOrAlter`
```java
private static Collection<Arguments> argsForShowCreateMaterializedTable() {
final Collection<Arguments> argList = new ArrayList<>();
addCreateAndCreateOrAlter(
argList,
createResolvedMaterialized(
ONE_COLUMN_SCHEMA,
null,
List.of(),
null,
IntervalFreshness.ofMinute("1"),
RefreshMode.CONTINUOUS,
"SELECT 1",
"SELECT 1"),
"CREATE %sMATERIALIZED TABLE
`catalogName`.`dbName`.`materializedTableName` (\n"
+ " `id` INT\n"
+ ")\n"
+ "FRESHNESS = INTERVAL '1' MINUTE\n"
+ "REFRESH_MODE = CONTINUOUS\n"
+ "AS SELECT 1\n");
//...
addCreateAndCreateOrAlter(
argList,
createResolvedMaterialized(
TWO_COLUMNS_SCHEMA,
"Materialized table comment",
List.of("id"),
TableDistribution.of(TableDistribution.Kind.HASH, 5,
List.of("id")),
IntervalFreshness.ofMinute("3"),
RefreshMode.FULL,
"SELECT * FROM tbl_a",
"SELECT id, name FROM `catalogName`.`dbName`.`tbl_a`"),
"CREATE %sMATERIALIZED TABLE
`catalogName`.`dbName`.`materializedTableName` (\n"
+ " `id` INT,\n"
+ " `name` VARCHAR(2147483647)\n"
+ ")\n"
+ "COMMENT 'Materialized table comment'\n"
+ "DISTRIBUTED BY HASH(`id`) INTO 5 BUCKETS\n"
+ "PARTITIONED BY (`id`)\n"
+ "FRESHNESS = INTERVAL '3' MINUTE\n"
+ "REFRESH_MODE = FULL\n"
+ "AS SELECT id, name FROM
`catalogName`.`dbName`.`tbl_a`\n");
return argList;
}
```
--
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]