For statistical analysis functions that don’t require a model, see
ML Functions.
CREATE CONTAINER REGISTRY
Creates a new reference to a Docker container registry for accessing ML models.CREATE CONTAINER REGISTRY Syntax
Parameters
OR REPLACE
OR REPLACE
Any existing container registry reference with the same name will be dropped before creating
this one
<registry name>
<registry name>
Name of the reference to the container registry, which can be referenced in subsequent
commands
URI
URI
The URI to the container registry itself
CREDENTIAL
CREDENTIAL
Name of the credential to use to authenticate to the
container registry
Examples
CREATE CONTAINER REGISTRY Example
DROP CONTAINER REGISTRY
Removes an existing Docker container registry reference.DROP CONTAINER REGISTRY Syntax
Parameters
<registry name>
<registry name>
Name of the reference to the container registry to remove; has no effect on the
container registry itself
Examples
DROP CONTAINER REGISTRY Example
SHOW CONTAINER REGISTRY
Outputs the DDL statement required to reconstruct the given Docker container registry reference.SHOW CONTAINER REGISTRY Syntax
The response to
SHOW CONTAINER REGISTRY is a single-column result
set with the DDL statement as the value in the DDL column.Parameters
<registry name>
<registry name>
Name of the existing reference to the container registry for which the DDL will be output.
Use
* instead to output the DDL of all references to container registries.Examples
SHOW CONTAINER REGISTRY Example
SHOW CONTAINER REGISTRY Example (All Registries)
IMPORT MODEL
Imports an ML model from a Docker container registry into the database.IMPORT MODEL Syntax
Parameters
<model name>
<model name>
Name of the ML model to import via the given container registry reference
REGISTRY
REGISTRY
Name of the reference to the container registry from which to import the ML model
CONTAINER
CONTAINER
The full path to the ML model container within the container registry
RUN_FUNCTION
RUN_FUNCTION
Name of the function within the ML model to execute when running inferences against it
Examples
IMPORT MODEL Example
EVALUATE_MODEL
Runs an inference against an ML model. There are two methods to evaluate a model:- By Query - An ML model can be queried, where the inference is returned as the result set.
- By Execution - An ML model can be run with the
EXECUTE FUNCTIONcommand, where the inference is persisted to a specified table.
EVALUATE_MODEL Table Function Syntax
EVALUATE_MODEL EXECUTE FUNCTION Syntax
Parameters
MODEL
MODEL
Name of the ML model on which to run an inference
DEPLOYMENT_MODE
DEPLOYMENT_MODE
Scheme used in making inferences on the ML model:
-
BATCH- inference tests are run against a batch of data in an existing table all at once -
CONTINUOUS- inference tests are run automatically against records being streamed into an input table; inference results are inserted into an output table, which will be updated upon each subsequent inferenceContinuous deployment mode is only available when using theEXECUTE FUNCTIONsyntax, as it creates a destination table with the continuously updated results.
REPLICATIONS
REPLICATIONS
The number of replicas to launch on Kubernetes
SOURCE_TABLE
SOURCE_TABLE
Table or query to use as input to the ML model, specified with either of these two forms:
-
INPUT_TABLE(<table name>)- Use the given table or view as input; e.g.: -
INPUT_TABLE(<query>)- Use the given query as input; e.g.:
DESTINATION_TABLE
DESTINATION_TABLE
Only applicable when using
EXECUTE FUNCTION syntax. Name of the table in which to store the
results of the inference, in [schema_name.]table_name format, using standard
name resolution rules and meeting
table naming criteriaExamples
EVALUATE_MODEL Table Function Example
EVALUATE_MODEL EXECUTE FUNCTION Example
ALTER MODEL
Modifies the source of an ML model and re-imports it from that new location. Either the container registry or the container path can be modified.Parameters
<model name>
<model name>
Name of the ML model to modify
REGISTRY
REGISTRY
Name of the reference to the container registry from which to import the ML model
CONTAINER
CONTAINER
The full path to the ML model container within the container registry
Examples
ALTER MODEL Registry Example
ALTER MODEL Container Path Example
REFRESH MODEL
Refreshes an ML model from its source.REFRESH MODEL Syntax
Examples
REFRESH MODEL Example
DROP MODEL
Removes an ML model.DROP MODEL Syntax
Examples
DROP MODEL Example
SHOW MODEL
Displays the statement used to create an ML model.SHOW MODEL Syntax
Parameters
<model name>
<model name>
Name of the existing reference to the model for which the DDL will be output.
Use
* instead to output the DDL of all references to models.Examples
SHOW MODEL Example
SHOW MODEL Example (All Models)
DESCRIBE MODEL
Displays the configuration of an ML model.DESCRIBE MODEL Syntax
Parameters
<model name>
<model name>
Name of the existing model for which the configuration will be output. Use
* instead
to output the configuration of all models.Response
The response toDESCRIBE MODEL is a four-column result set:
| Output Column | Description |
|---|---|
MODEL | Name of the ML model |
ENTITY_ID | Internal unique ID for the ML model |
INPUT_SCHEMA | List of columns types that valid input data is expected to match |
OUTPUT_SCHEMA | List of column types that will either be returned by the model as a result set or used in creating a result table, depending on how the model’s evaluation is invoked |
Examples
DESCRIBE MODEL Example
DESCRIBE MODEL Example (All Models)