Skip to content

Latest commit

 

History

History
59 lines (48 loc) · 2.16 KB

python_config.md

File metadata and controls

59 lines (48 loc) · 2.16 KB
title Configuration
weight 121
type docs
aliases
/dev/python/python_config.html

Configuration

Depending on the requirements of a Python API program, it might be necessary to adjust certain parameters for optimization.

For Python DataStream API program, the config options could be set as following:

from pyflink.common import Configuration
from pyflink.datastream import StreamExecutionEnvironment
from pyflink.util.java_utils import get_j_env_configuration

env = StreamExecutionEnvironment.get_execution_environment()
config = Configuration(j_configuration=get_j_env_configuration(env._j_stream_execution_environment))
config.set_integer("python.fn-execution.bundle.size", 1000)

For Python Table API program, all the config options available for Java/Scala Table API program could also be used in the Python Table API program. You could refer to the [Table API Configuration]({{< ref "docs/dev/table/config" >}}) for more details on all the available config options for Table API programs. The config options could be set as following in a Table API program:

from pyflink.table import TableEnvironment, EnvironmentSettings

env_settings = EnvironmentSettings.in_streaming_mode()
t_env = TableEnvironment.create(env_settings)

config = t_env.get_config().get_configuration()
config.set_integer("python.fn-execution.bundle.size", 1000)

Python Options

{{< generated/python_configuration >}}