lihaosky commented on code in PR #26603:
URL: https://github.com/apache/flink/pull/26603#discussion_r2114885735
##########
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:
@fsk119 , I put `createAsyncPredictFunction` inside `PredictRuntimeProvider`
and removed `AsyncPredictRuntimeProvider`. We can know the async option in
`StreamPhysicalMLPredictRule` which has access to config map and choose which
one to use in `ExecNode` later
--
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]