-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-15826][Tabel SQL/API] Add renameFunction() to Catalog #17788
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 e50aa0d (Sun Nov 14 00:16:48 UTC 2021) 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. 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:
|
* @throws FunctionAlreadyExistException if the function with newFunctionName already exists | ||
* @throws CatalogException in case of any runtime exception | ||
*/ | ||
void renameFunction(ObjectPath functionPath, String newFunctionName, boolean ignoreIfNotExists) |
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.
This is a breaking change. We should avoid this by default implementing the new method to throw an exception instead.
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.
This is a breaking change. We should avoid this by default implementing the new method to throw an exception instead.
Hey Airblader, thanks for your review!
renameFunction
is a new API, and I added implementations to all classes that implement this interface, including GenericInMemoryCatalog, AbstractJdbcCatalog, HiveCatalog and TestCatalog, it shouldn't break existing code. Do you mean add a default implementation in interface like this?
default void renameFunction(ObjectPath functionPath, String newFunctionName, boolean ignoreIfNotExists) throws FunctionNotExistException, FunctionAlreadyExistException, CatalogException {
throw new UnsupportedOperationException();
}
Thanks for your time:)
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.
You modified all the implementations within Flink, but Catalog
is a public API, so adding new methods is a breaking change, because user's custom implementations will no longer work without modification. So yes, it'd be good to default implement it as you showed in your comment, of course with a nice message for the exception.
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.
Hey Airblader, sorry I didn't realize that, thanks for your explanation! I will add a default implementation to throw an exception.
Hey @JingsongLi , thanks for assigning the ticket to me! Would you mind taking a look at this PR when you have a moment? |
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.
Sorry for the late reply, I think we can add test for HiveCatalog.
Maybe in |
4e6d4e3
to
b6a9b9e
Compare
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 @shenzhu ! Looks good to me!
@Airblader and @wuchong , do you have other comments?
b6a9b9e
to
52f18f5
Compare
Hey @Airblader , I got some architecture tests failing for this PR, the failing messages are as follows
Later I added Thanks for your help! |
@shenzhu I'm addressing those in #17898. In the meantime for this PR you can add the violations to the file since you're only exposing additional usages of those classes and not really new kinds of violations. I don't know if ObjectPath was ever intended to be public, but de facto it simply is now — the Catalog interface entirely relies on it. |
@shenzhu My PR was merged now. If you rebase I think those violations should not show up anymore. |
c693223
to
1adea58
Compare
Hey @Airblader , thanks for your PR! I just rebased my code, would you mind taking a look at this PR when you have a moment? |
Hey @wuchong , would you mind taking a look at this PR when you have a moment? Thanks! |
This PR is being marked as stale since it has not had any activity in the last 180 days. If you are having difficulty finding a reviewer, please reach out to the [community](https://flink.apache.org/what-is-flink/community/). If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 90 days, it will be automatically closed. |
This PR has been closed since it has not had any activity in 120 days. |
What is the purpose of the change
Add
renameFunction()
to Catalog.Brief change log
renameFunction()
to interfaceCatalog.java
GenericInMemoryCatalog.java
,AbstractJdbcCatalog.java
,HiveCatalog.java
CatalogTests.java
.Verifying this change
This change added tests and can be verified as follows:
Unit tests were added to
CatalogTests.java
to cover new function.Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation