You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "snuyanzin (via GitHub)" <gi...@apache.org> on 2026/03/27 12:53:13 UTC
[PR] [FLINK-39301][table] Support `START_MODE` clause in the parser [flink]
snuyanzin opened a new pull request, #27843:
URL: https://github.com/apache/flink/pull/27843
## What is the purpose of the change
Implementation of `START_MODE` in parser
## Brief change log
## Verifying this change
tests are added
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): ( no)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: ( no)
- The S3 file system connector: ( no)
## Documentation
- Does this pull request introduce a new feature? (yes )
- If yes, how is the feature documented? (there will be a separate PR)
--
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
Re: [PR] [FLINK-39301][table] Support `START_MODE` clause in the parser [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #27843:
URL: https://github.com/apache/flink/pull/27843#discussion_r3001525159
##########
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -1964,23 +1965,81 @@ SqlCreate SqlCreateOrAlterMaterializedTable(Span s, boolean replace, boolean isT
propertyList = Properties()
]
[
- <FRESHNESS> <EQ>
- freshness = Expression(ExprContext.ACCEPT_NON_QUERY)
+ <START_MODE> <EQ>
{
- if (!(freshness instanceof SqlIntervalLiteral))
+ SqlLiteral startModeKindLiteral = null;
+ SqlLiteral startModeLiteral = null;
+ }
+ (
+ <FROM_BEGINNING>
{
- throw SqlUtil.newContextException(
- getPos(),
- ParserResource.RESOURCE.unsupportedFreshnessType());
+ startModeKindLiteral = SqlStartModeKind.FROM_BEGINNING.symbol(getPos());
+ }
+ |
+ <FROM_NOW>
+ {
+ startModeKindLiteral = SqlStartModeKind.FROM_NOW.symbol(getPos());
+ }
+ [
+ <LPAREN>
+ {
+ startModeLiteral = IntervalLiteralOrError(Expression(ExprContext.ACCEPT_NON_QUERY),
+ ParserResource.RESOURCE.unsupportedStartModeType());
+ }
+ <RPAREN>
+ ]
+ |
+ <FROM_TIMESTAMP>
+ {
+ startModeKindLiteral = SqlStartModeKind.FROM_TIMESTAMP.symbol(getPos());
+ }
+ <LPAREN>
+ startModeLiteral = TimestampLiteral()
+ <RPAREN>
+ |
+ <RESUME_OR_FROM_BEGINNING>
+ {
+ startModeKindLiteral = SqlStartModeKind.RESUME_OR_FROM_BEGINNING.symbol(getPos());
+ }
+ |
+ <RESUME_OR_FROM_NOW>
+ {
+ startModeKindLiteral = SqlStartModeKind.RESUME_OR_FROM_NOW.symbol(getPos());
}
+ [
+ <LPAREN>
+ {
+ startModeLiteral = IntervalLiteralOrError(Expression(ExprContext.ACCEPT_NON_QUERY),
+ ParserResource.RESOURCE.unsupportedStartModeType());
+ }
+ <RPAREN>
+ ]
+ |
+ <RESUME_OR_FROM_TIMESTAMP>
+ {
+ startModeKindLiteral = SqlStartModeKind.RESUME_OR_FROM_TIMESTAMP.symbol(getPos());
+ }
+ <LPAREN>
+ startModeLiteral = TimestampLiteral()
+ <RPAREN>
+ )
+ {
+ startMode = new SqlStartMode(startModeKindLiteral, startModeLiteral, getPos());
+ }
+ ]
+ [
+ <FRESHNESS> <EQ>
+ {
+ freshness = IntervalLiteralOrError(Expression(ExprContext.ACCEPT_NON_QUERY),
+ ParserResource.RESOURCE.unsupportedFreshnessType());
}
]
[
<REFRESH_MODE> <EQ>
(
<FULL>
{
- refreshMode = SqlRefreshMode.FULL;
+ refreshMode = SqlRefreshMode.FULL;
Review Comment:
done
--
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
Re: [PR] [FLINK-39301][table] Support `START_MODE` clause in the parser [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #27843:
URL: https://github.com/apache/flink/pull/27843#discussion_r3001359718
##########
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/materializedtable/SqlStartMode.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.sql.parser.ddl;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.sql.parser.SqlParseUtils;
+
+import org.apache.calcite.sql.SqlIntervalLiteral;
+import org.apache.calcite.sql.SqlLiteral;
+import org.apache.calcite.sql.SqlTimestampLiteral;
+import org.apache.calcite.sql.SqlUnknownLiteral;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+
+import javax.annotation.Nullable;
+
+/** Start mode configuration for materialized tables. */
+@Internal
+public class SqlStartMode {
+ private final SqlStartModeKind kind;
+ private final @Nullable SqlTimestampLiteral timestampLiteral;
+ private final @Nullable SqlIntervalLiteral intervalLiteral;
+
+ public SqlStartModeKind getKind() {
+ return kind;
+ }
+
+ @Nullable
+ public SqlTimestampLiteral getTimestampLiteral() {
+ return timestampLiteral;
+ }
+
+ @Nullable
+ public SqlIntervalLiteral getIntervalLiteral() {
+ return intervalLiteral;
+ }
+
+ public enum SqlStartModeKind {
+ FROM_BEGINNING,
+ FROM_NOW,
+ FROM_TIMESTAMP,
+ RESUME_OR_FROM_BEGINNING,
+ RESUME_OR_FROM_NOW,
+ RESUME_OR_FROM_TIMESTAMP;
+
+ /**
+ * Creates a parse-tree node representing an occurrence of this keyword at a particular
+ * position in the parsed text.
+ */
+ public SqlLiteral symbol(SqlParserPos pos) {
+ return SqlLiteral.createSymbol(this, pos);
+ }
+
+ public boolean isFromNow() {
+ return this == FROM_NOW || this == RESUME_OR_FROM_NOW;
+ }
+
+ public boolean isFromTimestamp() {
+ return this == FROM_TIMESTAMP || this == RESUME_OR_FROM_TIMESTAMP;
+ }
+
+ public boolean isCreateOrAlterOption() {
+ return this == RESUME_OR_FROM_BEGINNING
+ || this == RESUME_OR_FROM_NOW
+ || this == RESUME_OR_FROM_TIMESTAMP;
+ }
+ }
+
+ public SqlStartMode(SqlLiteral kind, @Nullable SqlLiteral literal, SqlParserPos pos) {
+ this.kind = SqlParseUtils.extractEnum(kind, SqlStartModeKind.class);
+ if (literal == null) {
+ this.intervalLiteral = null;
+ this.timestampLiteral = null;
+ } else if (literal instanceof SqlIntervalLiteral) {
+ this.intervalLiteral = (SqlIntervalLiteral) literal;
+ this.timestampLiteral = null;
+ } else {
+ this.intervalLiteral = null;
+
+ final SqlUnknownLiteral unknownLiteral = (SqlUnknownLiteral) literal;
+ this.timestampLiteral =
+ (SqlTimestampLiteral)
+ unknownLiteral.resolve(SqlTypeName.lookup(unknownLiteral.tag));
+ }
Review Comment:
`literal` is not a type of `SqlTimestampLiteral`
however the result of `unknownLiteral.resolve(...)` is a type of `SqlTimestampLiteral` in this case
--
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
Re: [PR] [FLINK-39301][table] Support `START_MODE` clause in the parser [flink]
Posted by "raminqaf (via GitHub)" <gi...@apache.org>.
raminqaf commented on code in PR #27843:
URL: https://github.com/apache/flink/pull/27843#discussion_r3001343676
##########
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -1964,23 +1965,81 @@ SqlCreate SqlCreateOrAlterMaterializedTable(Span s, boolean replace, boolean isT
propertyList = Properties()
]
[
- <FRESHNESS> <EQ>
- freshness = Expression(ExprContext.ACCEPT_NON_QUERY)
+ <START_MODE> <EQ>
{
- if (!(freshness instanceof SqlIntervalLiteral))
+ SqlLiteral startModeKindLiteral = null;
+ SqlLiteral startModeLiteral = null;
+ }
+ (
+ <FROM_BEGINNING>
{
- throw SqlUtil.newContextException(
- getPos(),
- ParserResource.RESOURCE.unsupportedFreshnessType());
+ startModeKindLiteral = SqlStartModeKind.FROM_BEGINNING.symbol(getPos());
+ }
+ |
+ <FROM_NOW>
+ {
+ startModeKindLiteral = SqlStartModeKind.FROM_NOW.symbol(getPos());
+ }
+ [
+ <LPAREN>
+ {
+ startModeLiteral = IntervalLiteralOrError(Expression(ExprContext.ACCEPT_NON_QUERY),
+ ParserResource.RESOURCE.unsupportedStartModeType());
+ }
+ <RPAREN>
+ ]
+ |
+ <FROM_TIMESTAMP>
+ {
+ startModeKindLiteral = SqlStartModeKind.FROM_TIMESTAMP.symbol(getPos());
+ }
+ <LPAREN>
+ startModeLiteral = TimestampLiteral()
+ <RPAREN>
+ |
+ <RESUME_OR_FROM_BEGINNING>
+ {
+ startModeKindLiteral = SqlStartModeKind.RESUME_OR_FROM_BEGINNING.symbol(getPos());
+ }
+ |
+ <RESUME_OR_FROM_NOW>
+ {
+ startModeKindLiteral = SqlStartModeKind.RESUME_OR_FROM_NOW.symbol(getPos());
}
+ [
+ <LPAREN>
+ {
+ startModeLiteral = IntervalLiteralOrError(Expression(ExprContext.ACCEPT_NON_QUERY),
+ ParserResource.RESOURCE.unsupportedStartModeType());
+ }
+ <RPAREN>
+ ]
+ |
+ <RESUME_OR_FROM_TIMESTAMP>
+ {
+ startModeKindLiteral = SqlStartModeKind.RESUME_OR_FROM_TIMESTAMP.symbol(getPos());
+ }
+ <LPAREN>
+ startModeLiteral = TimestampLiteral()
+ <RPAREN>
+ )
+ {
+ startMode = new SqlStartMode(startModeKindLiteral, startModeLiteral, getPos());
+ }
+ ]
+ [
+ <FRESHNESS> <EQ>
+ {
+ freshness = IntervalLiteralOrError(Expression(ExprContext.ACCEPT_NON_QUERY),
+ ParserResource.RESOURCE.unsupportedFreshnessType());
}
]
[
<REFRESH_MODE> <EQ>
(
<FULL>
{
- refreshMode = SqlRefreshMode.FULL;
+ refreshMode = SqlRefreshMode.FULL;
Review Comment:
nit
```suggestion
refreshMode = SqlRefreshMode.FULL;
```
##########
flink-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/MaterializedTableStatementParserTest.java:
##########
@@ -665,6 +665,67 @@ void testDropTemporaryMaterializedTable() {
sql(sql).fails("DROP TEMPORARY MATERIALIZED TABLE is not supported.");
}
+ @Test
+ void testStartMode() {
+ final String sql1 =
+ "create materialized table tbl1 start_mode = from_beginning as select * from t";
+ sql(sql1)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = FROM_BEGINNING\nAS\nSELECT *\nFROM `T`");
+
+ final String sql2 =
+ "create materialized table tbl1 start_mode = from_now as select * from t";
+ sql(sql2)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = FROM_NOW\nAS\nSELECT *\nFROM `T`");
+
+ final String sql3 =
+ "create materialized table tbl1 start_mode = from_now(INTERVAL '1' HOUR) as select * from t";
+ sql(sql3)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = FROM_NOW(INTERVAL '1' HOUR)\nAS\nSELECT *\nFROM `T`");
+
+ final String sql4 =
+ "create materialized table tbl1 start_mode = from_timestamp(TIMESTAMP '2023-04-22 21:37:58') as select * from t";
+ sql(sql4)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = FROM_TIMESTAMP(TIMESTAMP '2023-04-22 21:37:58')\nAS\nSELECT *\nFROM `T`");
+
+ final String sql5 =
+ // allowed on parser level, in operation there is a validation for CREATE OR ALTER
+ // support only
+ "create materialized table tbl1 start_mode = resume_or_from_beginning as select * from t";
+ sql(sql5)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = RESUME_OR_FROM_BEGINNING\nAS\nSELECT *\nFROM `T`");
+
+ final String sql6 =
+ // allowed on parser level, in operation there is a validation for CREATE OR ALTER
+ // support only
+ "create materialized table tbl1 start_mode = resume_or_from_now as select * from t";
+ sql(sql6)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = RESUME_OR_FROM_NOW\nAS\nSELECT *\nFROM `T`");
+
+ final String sql7 =
+ // allowed on parser level, in operation there is a validation for CREATE OR ALTER
+ // support only
+ "create materialized table tbl1 start_mode = resume_or_from_now(interval '2' minutes) as select * from t";
Review Comment:
Should we try to add broken tests? For instance, `start_mode = resume_or_from_now(TIMESTAMP '2023-04-22 21:37:58')`
--
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
Re: [PR] [FLINK-39301][table] Support `START_MODE` clause in the parser [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #27843:
URL: https://github.com/apache/flink/pull/27843#issuecomment-4142411816
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2f67f6a4508282b8c5feb6b5f0c6676e80e3fd13",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "2f67f6a4508282b8c5feb6b5f0c6676e80e3fd13",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2f67f6a4508282b8c5feb6b5f0c6676e80e3fd13 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [FLINK-39301][table] Support `START_MODE` clause in the parser [flink]
Posted by "raminqaf (via GitHub)" <gi...@apache.org>.
raminqaf commented on code in PR #27843:
URL: https://github.com/apache/flink/pull/27843#discussion_r3001326508
##########
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/materializedtable/SqlStartMode.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.sql.parser.ddl;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.sql.parser.SqlParseUtils;
+
+import org.apache.calcite.sql.SqlIntervalLiteral;
+import org.apache.calcite.sql.SqlLiteral;
+import org.apache.calcite.sql.SqlTimestampLiteral;
+import org.apache.calcite.sql.SqlUnknownLiteral;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+
+import javax.annotation.Nullable;
+
+/** Start mode configuration for materialized tables. */
+@Internal
+public class SqlStartMode {
+ private final SqlStartModeKind kind;
+ private final @Nullable SqlTimestampLiteral timestampLiteral;
+ private final @Nullable SqlIntervalLiteral intervalLiteral;
+
+ public SqlStartModeKind getKind() {
+ return kind;
+ }
+
+ @Nullable
+ public SqlTimestampLiteral getTimestampLiteral() {
+ return timestampLiteral;
+ }
+
+ @Nullable
+ public SqlIntervalLiteral getIntervalLiteral() {
+ return intervalLiteral;
+ }
+
+ public enum SqlStartModeKind {
+ FROM_BEGINNING,
+ FROM_NOW,
+ FROM_TIMESTAMP,
+ RESUME_OR_FROM_BEGINNING,
+ RESUME_OR_FROM_NOW,
+ RESUME_OR_FROM_TIMESTAMP;
+
+ /**
+ * Creates a parse-tree node representing an occurrence of this keyword at a particular
+ * position in the parsed text.
+ */
+ public SqlLiteral symbol(SqlParserPos pos) {
+ return SqlLiteral.createSymbol(this, pos);
+ }
+
+ public boolean isFromNow() {
+ return this == FROM_NOW || this == RESUME_OR_FROM_NOW;
+ }
+
+ public boolean isFromTimestamp() {
+ return this == FROM_TIMESTAMP || this == RESUME_OR_FROM_TIMESTAMP;
+ }
+
+ public boolean isCreateOrAlterOption() {
+ return this == RESUME_OR_FROM_BEGINNING
+ || this == RESUME_OR_FROM_NOW
+ || this == RESUME_OR_FROM_TIMESTAMP;
+ }
+ }
+
+ public SqlStartMode(SqlLiteral kind, @Nullable SqlLiteral literal, SqlParserPos pos) {
+ this.kind = SqlParseUtils.extractEnum(kind, SqlStartModeKind.class);
+ if (literal == null) {
+ this.intervalLiteral = null;
+ this.timestampLiteral = null;
+ } else if (literal instanceof SqlIntervalLiteral) {
+ this.intervalLiteral = (SqlIntervalLiteral) literal;
+ this.timestampLiteral = null;
+ } else {
+ this.intervalLiteral = null;
+
+ final SqlUnknownLiteral unknownLiteral = (SqlUnknownLiteral) literal;
+ this.timestampLiteral =
+ (SqlTimestampLiteral)
+ unknownLiteral.resolve(SqlTypeName.lookup(unknownLiteral.tag));
+ }
Review Comment:
Question: Can you explain me why we go through this path of `SqlUnknownLiteral` and don't see if `literal instanceof SqlTimestampLiteral`? Just want to understand the intuition behind this approach
--
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
Re: [PR] [FLINK-39304][table] Support `START_MODE` clause in the parser [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on PR #27843:
URL: https://github.com/apache/flink/pull/27843#issuecomment-4145295517
@flinkbot run azure
--
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
Re: [PR] [FLINK-39304][table] Support `START_MODE` clause in the parser [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin merged PR #27843:
URL: https://github.com/apache/flink/pull/27843
--
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
Re: [PR] [FLINK-39301][table] Support `START_MODE` clause in the parser [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #27843:
URL: https://github.com/apache/flink/pull/27843#discussion_r3001526407
##########
flink-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/MaterializedTableStatementParserTest.java:
##########
@@ -665,6 +665,67 @@ void testDropTemporaryMaterializedTable() {
sql(sql).fails("DROP TEMPORARY MATERIALIZED TABLE is not supported.");
}
+ @Test
+ void testStartMode() {
+ final String sql1 =
+ "create materialized table tbl1 start_mode = from_beginning as select * from t";
+ sql(sql1)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = FROM_BEGINNING\nAS\nSELECT *\nFROM `T`");
+
+ final String sql2 =
+ "create materialized table tbl1 start_mode = from_now as select * from t";
+ sql(sql2)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = FROM_NOW\nAS\nSELECT *\nFROM `T`");
+
+ final String sql3 =
+ "create materialized table tbl1 start_mode = from_now(INTERVAL '1' HOUR) as select * from t";
+ sql(sql3)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = FROM_NOW(INTERVAL '1' HOUR)\nAS\nSELECT *\nFROM `T`");
+
+ final String sql4 =
+ "create materialized table tbl1 start_mode = from_timestamp(TIMESTAMP '2023-04-22 21:37:58') as select * from t";
+ sql(sql4)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = FROM_TIMESTAMP(TIMESTAMP '2023-04-22 21:37:58')\nAS\nSELECT *\nFROM `T`");
+
+ final String sql5 =
+ // allowed on parser level, in operation there is a validation for CREATE OR ALTER
+ // support only
+ "create materialized table tbl1 start_mode = resume_or_from_beginning as select * from t";
+ sql(sql5)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = RESUME_OR_FROM_BEGINNING\nAS\nSELECT *\nFROM `T`");
+
+ final String sql6 =
+ // allowed on parser level, in operation there is a validation for CREATE OR ALTER
+ // support only
+ "create materialized table tbl1 start_mode = resume_or_from_now as select * from t";
+ sql(sql6)
+ .ok(
+ "CREATE MATERIALIZED TABLE `TBL1`\nSTART_MODE = RESUME_OR_FROM_NOW\nAS\nSELECT *\nFROM `T`");
+
+ final String sql7 =
+ // allowed on parser level, in operation there is a validation for CREATE OR ALTER
+ // support only
+ "create materialized table tbl1 start_mode = resume_or_from_now(interval '2' minutes) as select * from t";
Review Comment:
added a couple of negative tests
--
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