Skip to main content
Ctrl+K
PyFlink 1.20+vvr.11.7.dev0 documentation - Home PyFlink 1.20+vvr.11.7.dev0 documentation - Home
  • API Reference
  • Examples
  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
    • TableEnvironment
    • Table
    • Data Types
    • Window
    • Expressions
    • User Defined Functions
    • Descriptors
    • StatementSet
    • Catalog
  • PyFlink DataStream
  • PyFlink DataFrame
  • PyFlink Common
  • API Reference
  • PyFlink Table
  • TableEnvironment
  • pyflink.table.table_environment.TableEnvironment.create_temporary_model

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 ModelDescriptor as 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.

previous

pyflink.table.table_environment.TableEnvironment.create_model

next

pyflink.table.table_environment.TableEnvironment.drop_function

On this page
  • TableEnvironment.create_temporary_model()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.