Google Cloud Dataflow (Apache Beam) - 我可以将 SideInputs 与 TextIO.write 一起使用吗?
Google Cloud Dataflow (Apache Beam) - Can I use SideInputs with TextIO.write?
目前看来我们只能使用 sideInputs
来 DoFn
在处理每个输入行时使用侧输入。
有什么方法可以利用 TextIO.Write
的输入吗?
就我而言,
outputTuple.get(deadletterTag)
.apply("Write to deadletter files",
TextIO.write().to(String.format("gs://dataflow-xxx/deadletter/%s/", uniqueID))
.withSuffix(".csv")
.withHeader(csvHeader)
).withSideInputs(csvHeaderView);
我有一个 csv header 信息作为 PCollectionView<String>
(在先前的过程中使用 Combine.globally
和 AsSingletonView
获得)并想以某种方式提取 header string 并将其分配给 withHeader
,但不确定是否可能,因为没有 ProcessContext
出现。
谢谢。
遗憾的是,从 Apache Beam 2.2.0 及更早版本开始,没有简单的方法可以做到这一点。
我创建了 BEAM-2771,它跟踪可以启用此功能的一般功能。
目前看来我们只能使用 sideInputs
来 DoFn
在处理每个输入行时使用侧输入。
有什么方法可以利用 TextIO.Write
的输入吗?
就我而言,
outputTuple.get(deadletterTag)
.apply("Write to deadletter files",
TextIO.write().to(String.format("gs://dataflow-xxx/deadletter/%s/", uniqueID))
.withSuffix(".csv")
.withHeader(csvHeader)
).withSideInputs(csvHeaderView);
我有一个 csv header 信息作为 PCollectionView<String>
(在先前的过程中使用 Combine.globally
和 AsSingletonView
获得)并想以某种方式提取 header string 并将其分配给 withHeader
,但不确定是否可能,因为没有 ProcessContext
出现。
谢谢。
遗憾的是,从 Apache Beam 2.2.0 及更早版本开始,没有简单的方法可以做到这一点。
我创建了 BEAM-2771,它跟踪可以启用此功能的一般功能。