I just learned that parallelism becomes 1 when agg...
# troubleshooting
s
I just learned that parallelism becomes 1 when aggregating a stream using
windowAll()
. What is the reasoning behind this?
You can also use windowing with non-keyed streams, but keep in mind that in this case, the processing will not be done in parallel:
https://nightlies.apache.org/flink/flink-docs-release-1.15/docs/learn-flink/streaming_analytics/#introduction-1
j
it would be nice to have something like
windowThis
that would apply a window only to unkeyed streams where, keeping the processing in whatever task it fell in via forwards.
m
It doesn’t change the parallelism for the whole job, but only the operator with the window all. However, as it says: “You can also use windowing with non-keyed streams, but keep in mind that in this case, the processing will not be done in parallel.” Why? Well, parallel processing uses random partitioning or keyed partitioning. But a "window all" will receive all the data in that window in an unpartitioned (not keyedBy) manner which is by definition not parallel. The "all" part means all the stream elements in that window! Sometimes that is required for the business logic. It’s a “fan in” type of operation. Think of it like multiple movies starting at 4:00 pm in which people enter the cinema through many doors but there is only one person to check / verify the ticket. You are forced to go through him because he needs to verify each person, even through they are watching different movies, entered through different doors. The business logic is required for the business. It’s obviously not ideal. You can speed up the processing by partitioning (ticket verify at each movie entrance ) or random (multiple ticket verifiers at the building entrance).
gratitude thank you 1
s
@Marco Villalobos makes sense now. thank u.