-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-15591][table] Support create/drop temporary table in Flink SQL #11917
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 Automated ChecksLast check on commit 487163f (Mon Apr 27 08:09:11 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. 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:
|
| dropTableOperation.getTableIdentifier(), | ||
| dropTableOperation.isIfExists()); | ||
| if (dropTableOperation.isTemporary()) { | ||
| boolean dropped = catalogManager.dropTemporaryTable(dropTableOperation.getTableIdentifier()); |
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.
I would suggest to extend catalogManager.dropTemporaryTable to take care of the logic about ifExists, be consistent with catalogManager.dropTable
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.
TableEnvironment#dropTemporaryTable and dropTemporaryView also return boolean which is consistent with CatalogManager#dropTemporaryTable and dropTemporaryView. Shall we refactor these interfaces in another ticket?
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.
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.
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.
OK. I can refactor the CatalogManager first.
| } | ||
|
|
||
| @Test | ||
| def testExecuteSqlWithCreateDropTemporaryTable(): Unit = { |
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.
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.
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.
BTW, will "show tables" command also show temporary tables?
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.
The ITCase testTemporaryTableMaskPermanentTableWithSameName test co-exists cases.
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.
show tables show both temporary and permanent tables
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.
I don't think testTemporaryTableMaskPermanentTableWithSameName is enough either
|
@KurtYoung added more tests, pls have another look. |
… the logic about ignoreIfExists
KurtYoung
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.
LGTM, thanks for the update, I will merge this after tests passed
|
@flinkbot run azure |
|
@rmetzger Looks like the ci system didn't capture the latest commit |
|
@docete can you do a rebase and force push to trigger the tests? |
|
Sorry for these issues Kurt! I asked Chesnay to look into the bot. |
|
Chesnay has deployed a (hopefully) fixed version of the bot. |
|
@rmetzger Thanks! |
|
@flinkbot run azure |
|
run mvn verify locally and passed |
What is the purpose of the change
This PR supports create/drop temporary table in Flink SQL
Brief change log
Verifying this change
This change added tests
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (yes / no)Documentation