lihaosky commented on code in PR #27108:
URL: https://github.com/apache/flink/pull/27108#discussion_r2448941480


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/Model.java:
##########
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.api;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.table.catalog.ContextResolvedModel;
+import org.apache.flink.table.catalog.ResolvedSchema;
+import org.apache.flink.types.ColumnList;
+
+import java.util.Map;
+
+/**
+ * The {@link Model} object is the core abstraction for ML model resources in 
the Table API.
+ *
+ * <p>A {@link Model} object describes a machine learning model resource that 
can be used for
+ * inference operations. It provides methods to perform prediction on data 
tables.
+ *
+ * <p>The {@link Model} interface offers main operations:
+ *
+ * <ul>
+ *   <li>{@link #predict(Table, ColumnList)} - Applies the model to make 
predictions on input data
+ * </ul>
+ *
+ * <p>{@code ml_predict} operation supports runtime options for configuring 
execution parameters
+ * such as asynchronous execution mode.
+ *
+ * <p>Every {@link Model} object has input and output schemas that describe 
the expected data
+ * structure for model operations, available through {@link 
#getResolvedInputSchema()} and {@link
+ * #getResolvedOutputSchema()}.
+ *
+ * <p>Example usage:
+ *
+ * <pre>{@code
+ * Model model = tableEnv.fromModelPath("my_model");
+ *
+ * // Simple prediction
+ * Table predictions = model.predict(inputTable, ColumnList.of("feature1", 
"feature2"));
+ *
+ * // Prediction with options
+ * Map<String, String> options = Map.of("max-concurrent-operations", "100", 
"timeout", "30s", "async", "true");
+ * Table predictions = model.predict(inputTable, ColumnList.of("feature1", 
"feature2"), options);
+ * }</pre>
+ */
+@PublicEvolving
+public interface Model {
+
+    /**
+     * Returns the underlying resolved model.
+     *
+     * <p>This method provides access to the internal representation of the 
model, including its
+     * configuration, input/output schemas, and other relevant details.
+     *
+     * @return the context resolved model metadata.
+     */
+    ContextResolvedModel getModel();

Review Comment:
   @twalthr , this forces `ContextResolvedModel` to be `PublicEvolving`. I 
guess one way to avoid it is to remove this method from `Model` and just add it 
in `ModelImpl`



-- 
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]

Reply via email to