The windowing section of the Beam programming model guide shows a window defined and used in the GroupyByKey transform after a ParDo. (section 7.1.1).
How long does a window remain in scope for an element?
Let's imagine a pipeline like this:
my_pcollection = p | MySourceOfData()
results_pcoll = (my_pcollection
| beam.WindowInto(..., triggering=...)
| beam.GroupByKey()
| beam.ParDo(DoSomeFormattingFn())
| beam.Combine.Globally(sum))
Suppose that the first window is aggregating by key, but in the second window you may want to combine elements across all keys.
How will the results_pcoll
look like? Will it be windowed? Will it be per-key?