-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
[FLINK-14906][table] create and drop temp system functions from DDL t… #10484
[FLINK-14906][table] create and drop temp system functions from DDL t… #10484
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 c604c9f (Sun Dec 08 04:41:27 UTC 2019) 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:
|
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.
because system functions and catalog functions are two different categories, I think 1) we need a Create/DropTempSystemFunctionOperation
despite existing Create/DropTempFunctionOperation
(which should be renamed to Create/DropCatalogFunctionOperation
), 2) we shouldn't use CatalogFunction
in the operation because of that, just use a string to store the function class should be fine.
public class CreateTempSystemFunctionOperation implements CreateOperation {
private final String functionName;
private String functionClass;
private boolean ignoreIfExists;
...
public class DropTempSystemFunctionOperation implements DropOperation {
private final String functionName;
private final boolean ifExists;
// private final boolean isTemporary; // no need for this, since ddl can only operate on temp system funtionc
* @param functionName the name of the function | ||
* @return whether the temporary system function exists in the function catalog | ||
*/ | ||
public boolean hasSystemCatalogFunction(String functionName) { |
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.
should be hasTempSystemFunction
...k-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlAlterFunction.java
Show resolved
Hide resolved
@@ -33,16 +33,22 @@ | |||
private final String className; // Fully qualified class name of the function | |||
private final FunctionLanguage functionLanguage; | |||
private final boolean isTemporary; | |||
private final boolean isSystem; |
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.
no need for this in catalog function
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.
Removed
c604c9f
to
3679bff
Compare
@bowenli86 Thanks for the feedback. I agree with your suggestion. We should distinguish system or catalog function from the very beginning. Thus, different types of operations should be created for system and catalog functions. |
1f803a0
to
3151c7b
Compare
…o FunctionCatalog
3151c7b
to
4a37049
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.
LGTM. tested locally
I will reformat the code for the following issues when merging
@@ -843,29 +878,65 @@ private void dropCatalogFunction(DropFunctionOperation dropFunctionOperation) { | |||
.getReturnTypeOfAggregateFunction(aggregateFunction); | |||
TypeInformation<ACC> accTypeInfo = UserFunctionsTypeHelper | |||
.getAccumulatorTypeOfAggregateFunction(aggregateFunction); | |||
|
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.
revert
functionCatalog.registerTempCatalogAggregateFunction( | ||
functionIdentifier, | ||
aggregateFunction, | ||
typeInfo, | ||
accTypeInfo); | ||
|
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.
revert
} else if (functionDefinition instanceof TableFunctionDefinition) { | ||
TableFunctionDefinition tableFunctionDefinition = (TableFunctionDefinition) functionDefinition; | ||
TableFunction<T> tableFunction = (TableFunction<T>) tableFunctionDefinition.getTableFunction(); | ||
TypeInformation<T> typeInfo = UserFunctionsTypeHelper | ||
.getReturnTypeOfTableFunction(tableFunction); | ||
|
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.
revert
protected TableImpl createTable(QueryOperation tableOperation) { | ||
return TableImpl.createTable( |
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.
revert
What is the purpose of the change
Support create and drop temp system functions from DDL to FunctionCatalog with function ddl.
Brief change log
Verifying this change
The features is covered in CatalogFunctionITCases
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation