本文簡要介紹 python 語言中 pyflink.table.TableConfig.set_python_executable
的用法。
用法:
set_python_executable(python_exec: str)
設置用於執行 python udf worker 的 python 解釋器的路徑。
例如“/usr/local/bin/python3”。
如果 python UDF 依賴於集群中不存在的特定 python 版本,該方法
pyflink.table.TableEnvironment.add_python_archive()
可用於上傳虛擬環境。通過該方法可以指定上傳環境中包含的python解釋器的路徑。例子:
# command executed in shell # assume that the relative path of python interpreter is py_env/bin/python $ zip -r py_env.zip py_env # python code >>> table_env.add_python_archive("py_env.zip") >>> table_env.get_config().set_python_executable("py_env.zip/py_env/bin/python")
注意:
請確保上傳的python環境與集群運行的平台相匹配,並且python版本必須為3.6或更高。
注意:
python udf worker 依賴於 Apache Beam(版本 == 2.27.0)。請確保指定的環境滿足上述要求。
參數:
python_exec - python 解釋器的路徑。
版本 1.10.0 中的新函數。
相關用法
- Python pyflink TableConfig.set_idle_state_retention_time用法及代碼示例
- Python pyflink TableConfig.set_idle_state_retention用法及代碼示例
- Python pyflink TableConfig用法及代碼示例
- Python pyflink Table.intersect_all用法及代碼示例
- Python pyflink Table.fetch用法及代碼示例
- Python pyflink TableEnvironment.create_temporary_function用法及代碼示例
- Python pyflink Table.right_outer_join用法及代碼示例
- Python pyflink Table.distinct用法及代碼示例
- Python pyflink TableEnvironment.register_table_source用法及代碼示例
- Python pyflink Table.where用法及代碼示例
- Python pyflink TableEnvironment.create_java_temporary_function用法及代碼示例
- Python pyflink Table.drop_columns用法及代碼示例
- Python pyflink Table.execute用法及代碼示例
- Python pyflink Table.minus_all用法及代碼示例
- Python pyflink TableEnvironment.use_catalog用法及代碼示例
- Python pyflink TableResult.collect用法及代碼示例
- Python pyflink Table.over_window用法及代碼示例
- Python pyflink TableEnvironment.create_temporary_system_function用法及代碼示例
- Python pyflink TableResult.get_table_schema用法及代碼示例
- Python pyflink TableDescriptor.Builder.option用法及代碼示例
- Python pyflink Table.union_all用法及代碼示例
- Python pyflink Table.left_outer_join_lateral用法及代碼示例
- Python pyflink Table.add_or_replace_columns用法及代碼示例
- Python pyflink Table.join用法及代碼示例
- Python pyflink Table.minus用法及代碼示例
注:本文由純淨天空篩選整理自apache.org大神的英文原創作品 pyflink.table.TableConfig.set_python_executable。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。