lihaosky commented on code in PR #26603:
URL: https://github.com/apache/flink/pull/26603#discussion_r2114847910
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/catalog/CatalogSchemaModel.java:
##########
@@ -85,4 +109,34 @@ private static RelDataType schemaToRelDataType(
.collect(Collectors.toList());
return typeFactory.buildRelNodeRowType(fieldNames, fieldTypes);
}
+
+ private ModelProvider createModelProvider(
+ FlinkContext context, ContextResolvedModel catalogModel) {
+
+ final Optional<ModelProviderFactory> factoryFromCatalog =
+ catalogModel
+ .getCatalog()
+ .flatMap(Catalog::getFactory)
+ .map(
+ f ->
+ f instanceof ModelProviderFactory
+ ? (ModelProviderFactory) f
+ : null);
+
+ final Optional<ModelProviderFactory> factoryFromModule =
+
context.getModuleManager().getFactory(Module::getModelProviderFactory);
+
+ // Since the catalog is more specific, we give it precedence over a
factory provided by any
+ // modules.
+ final ModelProviderFactory factory =
+ firstPresent(factoryFromCatalog,
factoryFromModule).orElse(null);
+
+ return FactoryUtil.createModelProvider(
Review Comment:
The `PredictRuntimeProvider` and `AsyncPredictRuntimeProvider` is a problem
here. We don't have access to the async config. The provider is choosed based
on `provider` option only
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]