-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-12831][table-planner][table-api-java] Split FunctionCatalog into Flink & Calcite specific parts #8729
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:
|
3bfae35 to
2fec3d8
Compare
2c87a9c to
d0d7c5f
Compare
aljoscha
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.
Looks good to merge! It's pretty neat now that the user-function catalog and the calcite catalog are separate. Makes me wonder why it wasn't like this before. 😅
| if (Arrays.stream(clazz.getFields()).anyMatch(f -> f.getName().equals("MODULE$"))) { | ||
| throw new ValidationException(String.format( | ||
| "TableFunction implemented by class %s " + | ||
| "is a Scala object, it is forbidden since concurrent risks.", clazz.getCanonicalName())); |
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 know it's not in the scope of the PR but this should be this is forbidden because of concurrency problems when using them. Or something like it.
| * Thin adapter between {@link SqlOperatorTable} and {@link FunctionCatalog}. | ||
| */ | ||
| @Internal | ||
| public class CatalogOperatorTable implements SqlOperatorTable { |
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 think I don't really have a better name but maybe making it obvious that this is a bridge or adapter would be useful.
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 sort of inline with naming of similar pattern for CatalogManagerCalciteSchema which bridges/adapts between CatalogManager & Calcite's Schema.
…to Flink & Calcite specific parts
d0d7c5f to
e22c695
Compare
9627db7 to
24bd894
Compare
| ).ifPresent(operatorList::add); | ||
| } | ||
|
|
||
| private boolean isUserFunction(SqlFunctionCategory category) { |
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.
Use 'isNotUserFunction' for more clear and less misleading
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.
Good catch! Thank you!
…to Flink & Calcite specific parts This closes apache#8729
What is the purpose of the change
This PR splits FunctionCatalog into Flink and Calcite specific parts. This is a necessary step to move the
TableEnvironmentto api module.Brief change log
FunctionCatalogto api-java moduleorg.apache.flink.table.catalog.CatalogOperatorTableas a thin adapter betweenFunctionCatalog&SqlOperatorTableVerifying this change
This change is already covered by existing tests.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (yes / no)Documentation