lsyldliu commented on code in PR #20001: URL: https://github.com/apache/flink/pull/20001#discussion_r917526478
########## flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/FunctionDefinitionFactory.java: ########## @@ -34,4 +35,29 @@ public interface FunctionDefinitionFactory { * @return a {@link FunctionDefinition} */ FunctionDefinition createFunctionDefinition(String name, CatalogFunction catalogFunction); + + /** + * Creates a {@link FunctionDefinition} from given {@link CatalogFunction}. If the {@link + * CatalogFunction} is created by user defined resource, the user of {@link + * FunctionDefinitionFactory} needs to override this method explicitly. The implementation logic + * needs to use the user classloader to load custom classes instead of the thread context + * classloader. + * + * @param name name of the {@link CatalogFunction} + * @param catalogFunction the catalog function + * @param userClassLoader the class loader is used to load user defined function's class + * @return a {@link FunctionDefinition} + */ + default FunctionDefinition createFunctionDefinition( + String name, CatalogFunction catalogFunction, ClassLoader userClassLoader) { Review Comment: We can't get the `Context` in `FunctionCatalog`, so this maybe not possible. BTW, there are different `Context` interface for `ModuleFactory`, `DynamicTableFactory` etc..., So I think this is unfeasible. If you need `ModuleManager`, we can add it function now. -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org