Following the official Documentation, you can use the Flatten
method in order to merge PCollections. Examples are provided in the 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())
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…