-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-12954] Supports create(drop) view grammar for sql parser #8850
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
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. DetailsThe 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:
|
de4b3ad to
b6669a7
Compare
wuchong
left a comment
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 , overall looks good to me.
I left some comments below.
| } | ||
|
|
||
| @Test | ||
| public void testCreateViewWithProperty() { |
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.
Please rename the method name.
Please also add some tests about create view without comment and drop view.
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.
done
| public List<SqlNode> getOperandList() { | ||
| List<SqlNode> ops = Lists.newArrayList(); | ||
| ops.add(viewName); | ||
| ops.add(fieldList); |
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 want to support field list in the first version? If not, I would suggest to remove it to keep compatible.
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.
Yes, we want to support this. So use can rename the field.
| SqlNodeList fieldList = SqlNodeList.EMPTY; | ||
| } | ||
| { | ||
| [ <OR> <REPLACE> { replaceView = true; } ] |
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.
We can remove this, the parameter replace already do this.
SqlCreateTable is the same.
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.
Yep, thanks.
|
LGTM |
What is the purpose of the change
CREATE VIEW view_name(col1, col2) AS select col3, col4 from tblBrief change log
Verifying this change
See tests in FlinkSqlParserimplTest.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation