Skip to content

Conversation

@docete
Copy link
Contributor

@docete docete commented Apr 27, 2020

What is the purpose of the change

This PR supports create/drop temporary table in Flink SQL

Brief change log

  • e172a38 support parsing TEMPORARY in table definition in sql parser
  • 74191ef support create/drop temporary table in blink planner
  • 487163f support create/drop temporary table in legacy planner

Verifying this change

This change added tests

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / 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.

Automated Checks

Last check on commit 487163f (Mon Apr 27 08:09:11 UTC 2020)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

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

dropTableOperation.getTableIdentifier(),
dropTableOperation.isIfExists());
if (dropTableOperation.isTemporary()) {
boolean dropped = catalogManager.dropTemporaryTable(dropTableOperation.getTableIdentifier());
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to extend catalogManager.dropTemporaryTable to take care of the logic about ifExists, be consistent with catalogManager.dropTable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TableEnvironment#dropTemporaryTable and dropTemporaryView also return boolean which is consistent with CatalogManager#dropTemporaryTable and dropTemporaryView. Shall we refactor these interfaces in another ticket?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are talking about CatalogManager's interface, I think it's make sense to compare the interfaces belong to CatalogManager. It looks a bit strange that some of the 'ignoreIfNotExists' logic is happened inside CatalogManager, but some of them are handled out of CatalogManager. I would suggest to keep it consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I can refactor the CatalogManager first.

}

@Test
def testExecuteSqlWithCreateDropTemporaryTable(): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Testing only the simplest "create + drop" will be insufficient. At least we have to cover some illegal cases, adding some cases when temporary & normal table co-exists.

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, will "show tables" command also show temporary tables?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ITCase testTemporaryTableMaskPermanentTableWithSameName test co-exists cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

show tables show both temporary and permanent tables

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think testTemporaryTableMaskPermanentTableWithSameName is enough either

@flinkbot
Copy link
Collaborator

flinkbot commented Apr 27, 2020

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

@docete
Copy link
Contributor Author

docete commented Apr 28, 2020

@KurtYoung added more tests, pls have another look.

Copy link
Contributor

@KurtYoung KurtYoung left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the update, I will merge this after tests passed

@KurtYoung
Copy link
Contributor

@flinkbot run azure

@KurtYoung
Copy link
Contributor

@rmetzger Looks like the ci system didn't capture the latest commit 647f123, and the manually trigger also doesn't work. Do you know any other ways to trigger the test?

@KurtYoung
Copy link
Contributor

@docete can you do a rebase and force push to trigger the tests?

@rmetzger
Copy link
Contributor

Sorry for these issues Kurt! I asked Chesnay to look into the bot.

@rmetzger
Copy link
Contributor

Chesnay has deployed a (hopefully) fixed version of the bot.

@KurtYoung
Copy link
Contributor

@rmetzger Thanks!

@rmetzger
Copy link
Contributor

@flinkbot run azure

KurtYoung pushed a commit to KurtYoung/flink that referenced this pull request Apr 30, 2020
@KurtYoung
Copy link
Contributor

run mvn verify locally and passed

@KurtYoung KurtYoung closed this in dca4a77 Apr 30, 2020
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