當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


Python pyflink StreamTableEnvironment.create用法及代碼示例


本文簡要介紹 python 語言中 pyflink.table.StreamTableEnvironment.create 的用法。

用法:

static create(stream_execution_environment: pyflink.datastream.stream_execution_environment.StreamExecutionEnvironment = None, environment_settings: pyflink.table.environment_settings.EnvironmentSettings = None) → pyflink.table.table_environment.StreamTableEnvironment

創建 StreamTableEnvironment

例子:

# create with StreamExecutionEnvironment.
>>> env = StreamExecutionEnvironment.get_execution_environment()
>>> table_env = StreamTableEnvironment.create(env)
# create with StreamExecutionEnvironment and EnvironmentSettings.
>>> configuration = Configuration()
>>> configuration.set_string('execution.buffer-timeout', '1 min')
>>> environment_settings = EnvironmentSettings \
...     .new_instance() \
...     .in_streaming_mode() \
...     .with_configuration(configuration) \
...     .build()
>>> table_env = StreamTableEnvironment.create(
...     env, environment_settings=environment_settings)
# create with EnvironmentSettings.
>>> table_env = StreamTableEnvironment.create(environment_settings=environment_settings)

參數:

  • stream_execution_environment- 這StreamExecutionEnvironment表環境的。

  • environment_settings- 用於實例化 TableEnvironment 的環境設置。

返回:

從給定的StreamExecutionEnvironment 和配置創建的StreamTableEnvironment。

相關用法


注:本文由純淨天空篩選整理自apache.org大神的英文原創作品 pyflink.table.StreamTableEnvironment.create。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。