pyflink.table.table_environment.TableEnvironment.create_temporary_model#
- TableEnvironment.create_temporary_model(model_path: str, model_descriptor: ModelDescriptor, ignore_if_exists: bool | None = False)[source]#
Registers the given
ModelDescriptoras a temporary catalog model similar to SQL temporary models.The ModelDescriptor is converted into a CatalogModel and stored in the catalog.
Temporary objects can shadow permanent ones. If a permanent object in a given path exists, it will be inaccessible in the current session. To make the permanent object available again one can drop the corresponding temporary object.
Examples:
>>> table_env.create_temporary_model("MyModel", ModelDescriptor ... .for_provider("OPENAI") ... .input_schema(Schema.new_builder() ... .column("f0", DataTypes.STRING()) ... .build()) ... .output_schema(Schema.new_builder() ... .column("label", DataTypes.STRING()) ... .build()) ... .option("task", "regression") ... .option("type", "remote") ... . ... . ... .build(), ... True)
- Parameters:
model_path – The path under which the model will be registered.
model_descriptor – Template for creating a CatalogModel instance.
ignore_if_exists – If a model exists under the given path and this flag is set, no operation is executed. An exception is thrown otherwise.
Added in version 2.1.0.