[英]Is it possible to efficiently convert PCollection list to PCollection (just values from the list)?
我知道可以使用 ParDo function 直接从列表中生成元素,但是还有其他直接或更有效的方法吗?
按照官方文档,您可以使用Flatten
方法来合并 PCollection。 Beam Programming Guide中提供了示例。
# Flatten takes a tuple of PCollection objects.
# Returns a single PCollection that contains all of the elements in the PCollection objects in that tuple.
merged = (
(pcoll1, pcoll2, pcoll3)
# A list of tuples can be "piped" directly into a Flatten transform.
| beam.Flatten())
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.