Skip to content

Conversation

@danny0405
Copy link
Contributor

@danny0405 danny0405 commented Jun 24, 2019

What is the purpose of the change

  • Add create view grammar like CREATE VIEW view_name(col1, col2) AS select col3, col4 from tbl

Brief change log

  • Add create/drop view

Verifying this change

See tests in FlinkSqlParserimplTest.

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, Yarn/Mesos, 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? not documented

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.

Details
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 commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@danny0405 danny0405 changed the title [FLINK-12954] Supports watermark and create view for sql parser [FLINK-12954] Supports create(drop) view grammar for sql parser Jun 24, 2019
@danny0405 danny0405 force-pushed the flink-12954 branch 2 times, most recently from de4b3ad to b6669a7 Compare June 27, 2019 06:11
Copy link
Member

@wuchong wuchong left a 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() {
Copy link
Member

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.

Copy link
Contributor Author

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);
Copy link
Member

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.

Copy link
Contributor Author

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; } ]
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, thanks.

@wuchong
Copy link
Member

wuchong commented Jun 28, 2019

LGTM
+1 to merge

wuchong pushed a commit to wuchong/flink that referenced this pull request Jun 28, 2019
@asfgit asfgit closed this in 71570bc Jun 28, 2019
@danny0405 danny0405 deleted the flink-12954 branch June 28, 2019 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants