写入1st之后是否可以使用Wait.on()方法(Apache Beam 2.4中的新功能)在批处理管道中写入第二个BigQuery表? Apache Beam文档中给出的示例是:
PCollection<Void> firstWriteResults = data.apply(ParDo.of(...write to first database...));
data.apply(Wait.on(firstWriteResults))
// Windows of this intermediate PCollection will be processed no earlier than when
// the respective window of firstWriteResults closes.
.apply(ParDo.of(...write to second database...));
但是为什么我会从ParDo中写入数据库?我们不能通过使用Dataflow中给出的I / O转换来做同样的事情吗?
谢谢 .
1 回答
是的,这是可能的,虽然有一些已知的限制,目前正在做一些工作来进一步支持这一点 .
为了完成这项工作,您可以执行以下操作:
应该注意,这仅适用于流式插入,不适用于文件加载 . 与此同时,目前正在做一些工作来更好地支持这个用例,你可以关注here
有用的参考:
http://moi.vonos.net/cloud/beam-send-pubsub/
http://osdir.com/apache-beam-users/msg02120.html