直接运行器中带有 SqlTransform 的 Apache Beam

问题描述 投票:0回答:2

我有以下代码可以在Windows上的直接运行器中的apache beam中运行sql转换。

import apache_beam as beam
from apache_beam.transforms.sql import SqlTransform

with beam.Pipeline() as p:
    pipe = (
        p
        |'hello' >> beam.Create([('SE',400),('SC',500)])
        |'schema' >> beam.Map(lambda x: beam.Row(
                                                state=x[0],
                                                population=x[1]
                                                ))
    )

    sql = (
        pipe
        |'sql' >> SqlTransform('SELECT state, population FROM PCOLLECTION')
        |'sql print' >> beam.Map(print)
    )

我收到以下错误:

  File "c:\users\XXX\appdata\local\programs\python\python37\lib\subprocess.py", line 1306, in send_signal
    raise ValueError("Unsupported signal: {}".format(sig))
ValueError: Unsupported signal: 2

我在youtube上看到专家说Universal Local Runner,但我没有找到如何安装它。

有人可以帮助我吗?

提前谢谢您

python sql apache-beam
2个回答
0
投票

现已在 https://issues.apache.org/jira/browse/BEAM-12501 中跟踪该问题。

使用从 Beam head 构建的源代码运行您的管道没有任何问题。但我用的是 Mac 操作系统。您使用什么版本的 Beam?

您可以尝试向 [email protected] 询问吗?这可能是 Windows 系统特有的问题。


0
投票

我在 Windows 中仍然面临同样的问题。 Windows SqlTransform issue

© www.soinside.com 2019 - 2024. All rights reserved.