【问题标题】:ParDo function with more than one input具有多个输入的 ParDo 函数
【发布时间】:2021-02-24 09:28:06
【问题描述】:

我想使用适用于 Apache Beam 的 Go SDK,我正在尝试创建一个计算两个向量的点积的管道。

Computesit(a, b []int)int {
return a.Dot(b)
}
A:= beam.Create(s, []int{1,2})
B:= beam.Create(s, []int{3,4})
Dot := beam.ParDo(s,Computesit, A, B)

但我收到以下错误

Cannot use B (type.PCollection) as type beam.Option in argument to beam.ParDo

我的问题是,如果有可能,我们如何向 ParDo 函数发出多个输入呢? 谢谢。

【问题讨论】:

  • 你有什么问题?
  • 问题已编辑

标签: go sdk apache-beam


【解决方案1】:

您可以使用侧输入来提供额外的 PCollection 作为输入。请参阅example

有一个类似的问题Go SDK Apache Beam : singleton side input Singleton for int ill-defined,其中包含更多示例代码。

【讨论】:

    猜你喜欢
    • 2011-05-26
    • 1970-01-01
    • 2017-10-05
    • 1970-01-01
    • 2017-02-02
    • 1970-01-01
    • 1970-01-01
    • 2020-08-25
    • 2022-01-10
    相关资源
    最近更新 更多