You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "lihaosky (via GitHub)" <gi...@apache.org> on 2025/06/20 05:19:21 UTC
Re: [PR] [FLINK-37797] Model documentation [flink]
lihaosky commented on code in PR #26694:
URL: https://github.com/apache/flink/pull/26694#discussion_r2158071200
##########
docs/content/docs/dev/table/sql/show.md:
##########
@@ -1037,4 +1038,58 @@ Show the jobs in the Flink cluster.
<span class="label label-danger">Attention</span> Currently `SHOW JOBS` statements only work in the [SQL CLI]({{< ref "docs/dev/table/sqlClient" >}}) or [SQL Gateway]({{< ref "docs/dev/table/sql-gateway/overview" >}}).
+## SHOW MODELS
+
+```sql
+SHOW MODELS [ ( FROM | IN ) [catalog_name.]database_name ] [ [NOT] (LIKE | ILIKE) <sql_like_pattern> ]
+```
+
+Show all models for an optionally specified database. If no database is specified then the models are returned from the current database. Additionally, a `<sql_like_pattern>` can be used to filter the models.
+
+**LIKE**
+Show all models with a `LIKE` clause, whose name is similar to the `<sql_like_pattern>`.
+
+The syntax of the SQL pattern in the `LIKE` clause is the same as that of the `MySQL` dialect.
+* `%` matches any number of characters, even zero characters, and `\%` matches one `%` character.
+* `_` matches exactly one character, `\_` matches one `_` character.
+
+**ILIKE**
+The same behavior as `LIKE` but the SQL pattern is case-insensitive.
+
+## SHOW CREATE MODEL
+
+```sql
+SHOW CREATE MODEL [catalog_name.][db_name.]model_name
+```
+
+Show create model statement for specified model.
+
+The output includes the model name, model type, model options, and other configurations. This statement is useful when you need to understand the structure and configuration of an existing model or to recreate the model in another database.
+
+Assumes that the model `my_model` is created as follows:
Review Comment:
Yes. It's just an example
##########
docs/content/docs/dev/table/sql/create.md:
##########
@@ -890,3 +891,46 @@ Language tag to instruct Flink runtime how to execute the function. Currently on
Specifies the list of jar resources that contain the implementation of the function along with its dependencies. The jar should be located in a local or remote [file system]({{< ref "docs/deployment/filesystems/overview" >}}) such as hdfs/s3/oss which Flink current supports.
<span class="label label-danger">Attention</span> Currently only JAVA, SCALA language support USING clause.
+
+{{< top >}}
+
+## CREATE MODEL
+```sql
+CREATE [TEMPORARY] MODEL [IF NOT EXISTS] [catalog_name.][db_name.]model_name
+ [(
+ { <input_column_definition> }[ , ...n]
+ { <output_column_definition> }[ , ...n]
+ )]
+ [COMMENT model_comment]
+ WITH (key1=val1, key2=val2, ...)
+
+<input_column_definition>:
+ column_name column_type [COMMENT column_comment]
+
+<output_column_definition>:
+ column_name column_type [COMMENT column_comment]
+```
+
+Create a model with optional input and output column definitions. If a model with the same name already exists in the catalog, an exception is thrown.
+
+**TEMPORARY**
+
+Create a temporary model that has catalog and database namespaces and overrides models.
+
+**IF NOT EXISTS**
+
+If the model already exists, nothing happens.
+
+**Input/Output Columns**
+
+The input columns define the features that will be used for model inference. The output columns define the predictions that the model will produce. Each column must have a name and data type. The input and output columns
Review Comment:
Sure
##########
docs/content/docs/dev/table/sql/create.md:
##########
@@ -890,3 +891,46 @@ Language tag to instruct Flink runtime how to execute the function. Currently on
Specifies the list of jar resources that contain the implementation of the function along with its dependencies. The jar should be located in a local or remote [file system]({{< ref "docs/deployment/filesystems/overview" >}}) such as hdfs/s3/oss which Flink current supports.
<span class="label label-danger">Attention</span> Currently only JAVA, SCALA language support USING clause.
+
+{{< top >}}
+
+## CREATE MODEL
+```sql
+CREATE [TEMPORARY] MODEL [IF NOT EXISTS] [catalog_name.][db_name.]model_name
+ [(
+ { <input_column_definition> }[ , ...n]
+ { <output_column_definition> }[ , ...n]
+ )]
+ [COMMENT model_comment]
+ WITH (key1=val1, key2=val2, ...)
+
+<input_column_definition>:
+ column_name column_type [COMMENT column_comment]
+
+<output_column_definition>:
+ column_name column_type [COMMENT column_comment]
+```
+
+Create a model with optional input and output column definitions. If a model with the same name already exists in the catalog, an exception is thrown.
+
+**TEMPORARY**
+
+Create temporary model that has catalog and database namespaces and overrides models.
+
+**IF NOT EXISTS**
+
+If the model already exists, nothing happens.
+
+**Input/Output Columns**
+
+The input columns define the features that will be used for model inference. The output columns define the predictions that the model will produce. Each column must have a name and data type. The input and output columns
+are optional because it can be inferred from training data later if Flink supports model training. For existing models, they are required to be defined.
Review Comment:
Will remove it
--
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-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org