我在学习使用Pyflink,按照官方教程的案例运行却报错了,有了解的能帮忙看下吗
教程 https://www.bookstack.cn/read/flink-1.15-zh/6fc705c52a6e6cea.md
代码
from pyflink.table import EnvironmentSettings, TableEnvironment
# 创建 批 TableEnvironment
env_settings = EnvironmentSettings.in_batch_mode()
table_env = TableEnvironment.create(env_settings)
table = table_env.from_elements([(1, 'Hi'), (2, 'Hello')])
table.execute().print()
报错
Traceback (most recent call last):
File "/data/flink/python/word_count.py", line 5, in <module>
table = table_env.from_elements([(1, 'Hi'), (2, 'Hello')])
File "/usr/local/lib/python3.8/dist-packages/pyflink/table/table_environment.py", line 1428, in from_elements
return self._from_elements(elements, schema)
File "/usr/local/lib/python3.8/dist-packages/pyflink/table/table_environment.py", line 1447, in _from_elements
j_table = PythonTableUtils.createTableFromElement(
File "/usr/local/lib/python3.8/dist-packages/py4j/java_gateway.py", line 1546, in __getattr__
raise Py4JError(
py4j.protocol.Py4JError: org.apache.flink.table.utils.python.PythonTableUtils.createTableFromElement does not exist in the JVM