如何 运行 在 apache flink 上用 python 编写的光束管道

How to run a beam pipeline written in python on apache flink

我已经使用 python sdk 编写了我的 Beam 管道。我正在使用芹菜作为直接跑步者的包装。 我想使用 flink runner 来并行化我的负载。

根据文档,您需要将作业作为 flink runner 的 jar 文件提供。

你能给我指点我可以同时使用 apache beam python sdk 和 apache flink 的任何资源吗? 有样品吗?

目前 (Apache Beam 2.2.0) 不支持 Apache Beam Python SDK 的 Apache Flink Runner。当您尝试在 Python 管道中使用 FlinkRunner 时,您将得到 ValueError:

ValueError: Unexpected pipeline runner: FlinkRunner. Valid values are DirectRunner, EagerRunner, DataflowRunner, TestDataflowRunner or the fully qualified name of a PipelineRunner subclass.

你可以在源代码中看到这个,在这里:https://github.com/apache/beam/blob/d11b9e9560131f55b418a13a7d10401c2135fb33/sdks/python/apache_beam/runners/runner.py#L62