snuyanzin commented on code in PR #26990:
URL: https://github.com/apache/flink/pull/26990#discussion_r2352111343
##########
flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/api/internal/ShowCreateUtilTest.java:
##########
@@ -272,27 +280,27 @@ private static Collection<Arguments>
argsForShowCreateMaterializedTable() {
ONE_COLUMN_SCHEMA,
null,
List.of(),
+ null,
IntervalFreshness.ofMinute("1"),
RefreshMode.CONTINUOUS,
"SELECT 1"),
- "CREATE %sMATERIALIZED TABLE
`catalogName`.`dbName`.`materializedTableName` (\n"
- + " `id` INT\n"
- + ")\n"
+ "CREATE %sMATERIALIZED TABLE
`catalogName`.`dbName`.`materializedTableName`\n"
+ "FRESHNESS = INTERVAL '1' MINUTE\n"
+ "REFRESH_MODE = CONTINUOUS\n"
+ "AS SELECT 1\n");
addTemporaryAndPermanent(
argList,
createResolvedMaterialized(
- ONE_COLUMN_SCHEMA,
+ ONE_COLUMN_SCHEMA_WITH_PRIMARY_KEY,
null,
List.of(),
+ null,
IntervalFreshness.ofMinute("1"),
RefreshMode.CONTINUOUS,
"SELECT 1"),
"CREATE %sMATERIALIZED TABLE
`catalogName`.`dbName`.`materializedTableName` (\n"
- + " `id` INT\n"
Review Comment:
yes, in case of `CREATE TABLE AS` we can do this and parser is more advanced
https://github.com/apache/flink/blob/3bc4f4fc17de1de758be7aca094146dfec844a37/flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl#L1564-L1572
in case of `CREATE MATERIALIZED TABLE` there is only constraint option
https://github.com/apache/flink/blob/3bc4f4fc17de1de758be7aca094146dfec844a37/flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl#L1886-L1888
and at the very end the query itself
https://github.com/apache/flink/blob/3bc4f4fc17de1de758be7aca094146dfec844a37/flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl#L1929-L1930
--
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]