-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-6962] [table] Add create(drop) table SQL DDL #8548
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
...ble/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlWatermarkStrategy.java
Outdated
Show resolved
Hide resolved
* method #execute(type) method, the 'type' argument should be the subclass | ||
* type for the supported {@link SqlNode}. | ||
*/ | ||
public class SqlExecutableStatement implements ReflectiveVisitor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have another choice here? I would suggest to not rely on or using refections if we have other choices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to separate the SqlNode
and TableEnvironment
interaction logic, the implementation must relay on the specific implementation abstractions(say TableEnvironment, CatalogTable ..), personally i don't want to mix-in these abstractions to the parser module (make it clean and with better reusability).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So a tool class like this may be a better choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @danny0405
...-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/calcite/SqlParserTest.java
Outdated
Show resolved
Hide resolved
...table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/FlinkSqlParserImplTest.java
Outdated
Show resolved
Hide resolved
...table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/FlinkSqlParserImplTest.java
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/SqlProperty.java
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlHiddenColumn.java
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlTableColumn.java
Outdated
Show resolved
Hide resolved
...flink-table-planner/src/main/java/org/apache/flink/table/sqlexec/SqlExecutableStatement.java
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. I went through the code quickly and left some comments.
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlHiddenColumn.java
Outdated
Show resolved
Hide resolved
705a86d
to
11b0e4a
Compare
cbbe622
to
9a56d11
Compare
Please delete watermark related changes from this pr |
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/SqlProperty.java
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlCreateTable.java
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlCreateTable.java
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlCreateTable.java
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlCreateTable.java
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlTableColumn.java
Show resolved
Hide resolved
83f0861
to
4631975
Compare
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlCreateTable.java
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/SqlProperty.java
Outdated
Show resolved
Hide resolved
flink-table/flink-sql-parser/src/main/resources/META-INF/NOTICE
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice job! I will leave SqlExecutableStatement
discuss to the following PRs when you start to connect parser with TableEnv
@danny0405 Maybe the merging happened too quickly for this PR. It is still not 100% aligned with FLIP-37. We should make sure to do that before the release. In particular:
Furthermore it would be great if the parser would already support all data types defined in FLIP-37 otherwise we need to check for compatibility in every corner of the stack again. Missing are (among others): CHAR, BINARY, user-defined type identifiers, MULTISET |
@twalthr Thanks for pointing this out. I think some of the items you listed are in our following plans. We planned to first commit the parser module and set up the structures to unblock other efforts like hive extension, and leave other issues as follow up improvements. Your comprehensive list would be very helpful. |
@KurtYoung is great to unblock other efforts but we should not merge half-baked contributions. Other contributions could also just rebase on this PR for being unblock until it is in a good final shape. The list that I mentioned is not a list of improvements but critical bugs/release blockers. If the goal was to simply add a first parser implementation, then the title of this PR and also the JIRA should have been renamed. The JIRA issue had 14 watchers but the feature is not complete even though the issue is closed now. |
For other data types that are listed in FLIP-37 but not in this PR, i would rather fire a new JIRA issue for tracing them, after all, |
What is the purpose of the change
This pull request create a new module flink-sql-parser as a sub-module of flink-table. As a startup, only createTable/dropTable ddl grammar are supported for this patch. There also introduces a bridge class named
SqlExecutableStatement
which handle all the interaction betweenSqlNode
toTableEnvironment
.Brief change log
Verifying this change
This change is already covered by existing tests, such as FlinkSqlParserImplTest and FlinkSqlUnParserTest.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation