bowenli86 commented on a change in pull request #10476: [FLINK-14911] [table]
register and drop temp catalog functions from D…
URL: https://github.com/apache/flink/pull/10476#discussion_r355057237
##########
File path:
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/internal/TableEnvImpl.scala
##########
@@ -696,51 +696,116 @@ abstract class TableEnvImpl(
}
private def createCatalogFunction(createFunctionOperation:
CreateFunctionOperation)= {
- val catalog = getCatalogOrThrowException(
- createFunctionOperation.getFunctionIdentifier.getCatalogName)
val exMsg =
getDDLOpExecuteErrorMsg(createFunctionOperation.asSummaryString)
try {
- catalog.createFunction(
- createFunctionOperation.getFunctionIdentifier.toObjectPath,
- createFunctionOperation.getCatalogFunction,
- createFunctionOperation.isIgnoreIfExists)
+ val function = createFunctionOperation.getCatalogFunction
+ if (function.isTemporary) {
+ val exist = functionCatalog.hasTemporaryCatalogFunction(
+ createFunctionOperation.getFunctionIdentifier);
+ if (!exist) {
+ val functionDefinition =
FunctionDefinitionUtil.createFunctionDefinition(
+ createFunctionOperation.getFunctionName, function)
+ registerFunctionInFunctionCatalog(
+ createFunctionOperation.getFunctionIdentifier,
+ functionDefinition)
+ } else if (!createFunctionOperation.isIgnoreIfExists) {
+ throw new
FunctionAlreadyExistException(FunctionCatalog.TEMPORARY_CATALOG,
Review comment:
ditto
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services