[
https://issues.apache.org/jira/browse/CALCITE-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18023908#comment-18023908
]
Sergey Nuyanzin commented on CALCITE-7208:
------------------------------------------
I was thinking of core parser since ideally we want to have it in Flink as well
as part of
(https://cwiki.apache.org/confluence/display/FLINK/FLIP-546%3A+Introduce+CREATE+OR+ALTER+for+Materialized+Tables)
where reasoning for syntax is similar to Snowflake's one.
Also same {{CREATE OR ALTER}} is available
for other vendors like
MSSQL
(https://learn.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql?view=sql-server-ver16),
Firebird
(https://www.firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref50/fblangref50-ddl-procedure.html#fblangref50-ddl-proc-crtoralter)
> Allow CREATE OR ALTER in parser
> -------------------------------
>
> Key: CALCITE-7208
> URL: https://issues.apache.org/jira/browse/CALCITE-7208
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Sergey Nuyanzin
> Priority: Major
>
> Currently there is
> {code:sql}
> <CREATE> { s = span(); }
> [
> <OR> <REPLACE> {
> replace = true;
> }
> ]
> {code}
> in parser
> https://github.com/apache/calcite/blob/9014934d8c24a5242a6840efe20134e820426c24/core/src/main/codegen/templates/Parser.jj#L4441-L4446
> .
> And this disallows to have custom implementation in parser for other than
> {{CREATE OR REPLACE}} operations like {{CREATE OR ALTER}} (e.g. Snowflake
> dialect https://docs.snowflake.com/en/sql-reference/sql/create-or-alter) .
> I see 2 options: either add one more {{lookahead}} and allow downstream
> project to have it or add it in Calcite and instead of {{boolean}}
> {{replace}} started having enum for that
--
This message was sent by Atlassian Jira
(v8.20.10#820010)