Python 是否可以有效地将PCollection列表转换为PCollection(仅转换列表中的值)?

Python 是否可以有效地将PCollection列表转换为PCollection(仅转换列表中的值)?,python,mapreduce,apache-beam,Python,Mapreduce,Apache Beam,我知道可以使用直接从列表中生成元素的ParDo函数,但是还有其他直接或更有效的方法吗?在之后,您可以使用展平方法来合并PCollection。中提供了示例 PCollection列表不同于不同PCollection的元组。这是一个常规的PCollection对象。@PartheshSoni您到目前为止尝试了什么?也许您可以添加一些上下文、您尝试的代码以及预期行为和实际行为之间的区别,以便我们帮助您 # Flatten takes a tuple of PCollection objects. #

我知道可以使用直接从列表中生成元素的ParDo函数,但是还有其他直接或更有效的方法吗?

在之后,您可以使用
展平
方法来合并PCollection。中提供了示例


PCollection列表不同于不同PCollection的元组。这是一个常规的PCollection对象。@PartheshSoni您到目前为止尝试了什么?也许您可以添加一些上下文、您尝试的代码以及预期行为和实际行为之间的区别,以便我们帮助您
# 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())