pyflink.table.table_config.TableConfig#
- class TableConfig(j_table_config=None)[source]#
Configuration for the current
TableEnvironment
session to adjust Table & SQL API programs.This class is a pure API class that abstracts configuration from various sources. Currently, configuration can be set in any of the following layers (in the given order):
flink-conf.yaml
CLI parameters
StreamExecutionEnvironment
when bridging to DataStream APIwith_configuration()
set()
The latter two represent the application-specific part of the configuration. They initialize and directly modify
get_configuration()
. Other layers represent the configuration of the execution context and are immutable.The getter
get()
gives read-only access to the full configuration. However, application-specific configuration has precedence. Configuration of outer layers is used for defaults and fallbacks. The setterset()
will only affect application-specific configuration.For common or important configuration options, this class provides getters and setters methods with detailed inline documentation.
For more advanced configuration, users can directly access the underlying key-value map via
get_configuration()
.Example:
>>> table_config = t_env.get_config() >>> config = Configuration() >>> config.set_string("parallelism.default", "128") \ ... .set_string("pipeline.auto-watermark-interval", "800ms") \ ... .set_string("execution.checkpointing.interval", "30s") >>> table_config.add_configuration(config)
Note
Because options are read at different point in time when performing operations, it is recommended to set configuration options early after instantiating a table environment.
Methods
add_configuration
(configuration)Adds the given key-value configuration to the underlying configuration.
get
(key, default_value)Returns the value associated with the given key as a string.
get_configuration
()Gives direct access to the underlying key-value map for advanced configuration.
get_default
()- return
A TableConfig object with default settings.
get_idle_state_retention
()- return
The duration until state which was not updated will be retained.
get_local_timezone
()Returns the local timezone id for timestamp with local time zone, either an abbreviation such as "PST", a full name such as "America/Los_Angeles", or a custom timezone_id such as "GMT-08:00".
get_max_generated_code_length
()The current threshold where generated code will be split into sub-function calls.
get_max_idle_state_retention_time
()State will be cleared and removed if it was not updated for the defined period of time.
get_min_idle_state_retention_time
()State might be cleared and removed if it was not updated for the defined period of time.
get_python_executable
()Gets the path of the python interpreter which is used to execute the python udf workers.
get_sql_dialect
()Returns the current SQL dialect.
set
(key, value)Sets a string-based value for the given string-based key.
set_idle_state_retention
(duration)Specifies a retention time interval for how long idle state, i.e., state which was not updated, will be retained.
set_idle_state_retention_time
(min_time, max_time)Specifies a minimum and a maximum time interval for how long idle state, i.e., state which was not updated, will be retained.
set_local_timezone
(timezone_id)Sets the local timezone id for timestamp with local time zone.
set_max_generated_code_length
(...)Returns the current threshold where generated code will be split into sub-function calls.
set_python_executable
(python_exec)Sets the path of the python interpreter which is used to execute the python udf workers.
set_sql_dialect
(sql_dialect)Sets the current SQL dialect to parse a SQL query.