Jianhui Dong created FLINK-25272:
------------------------------------

             Summary: Flink sql syntax analysis is inconsistent with the sql 
grammer declared now
                 Key: FLINK-25272
                 URL: https://issues.apache.org/jira/browse/FLINK-25272
             Project: Flink
          Issue Type: Improvement
          Components: Table SQL / API
            Reporter: Jianhui Dong


Syntax analysis in the 
code(https://github.com/apache/flink/blob/master/flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl)
 is inconsistent with the grammar declared on the 
module(https://github.com/apache/flink/edit/master/docs/content/docs/dev/table/sql/create.md).
The document states that all CREATE statement formats are `CREATE TABLE [IF NOT 
EXISTS]`, there is no `TEMPORAL` keywords, but in 
flink-sql-parser/src/main/codegen/includes/parserImpls.ftl::SqlCreateExtended, 
it will recorganize `TEMPORAL` token and set `isTemporary` with true if the 
keyword exists.
Besides, I think the field `isTemporary` is outdated too, every table in Flink 
is temporal table as the document wrote. In fact, when they are stored in the 
catalog, they are all converted to `CatalogSchemaTable` which inherits the 
`TemporalTable` interface.
BTW, the view and the function has the same condition. IMO, I think we should 
remove the `TEMPORAL` token in parserImpls.ftl and also remove the 
`isTemporary` field which now always is false.
This issue may be a little confused cause my English is not very well. If you 
have any questions, you can add comments under the issue or contact me with 
lam...@apache.org.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to