-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow different window assigners / time windows in WindowGraphAggregation #25
Conversation
logic extracted directly from toString, as it's generally useful (I needed it).
…tion Unit test added for Connected Components over a Sliding Window. All other tests still pass, these changes are backwards compatible. fixes vasia#2
Hi @drfloob, |
@vasia thanks, I'm fairly new to flink, maybe there is a simpler way to accomplish what I'm after? I am computing connected component over a sliding window without aggregation -- emitting the connected components that exist in each window. The Connected Components example was (apparently) tightly coupled with the WindowGraphAggregation class, so I found modifying it to be the shortest path to a working solution. Can it be done another way? Cheers, |
To clarify, I taught WindowGraphAggregation how to do this (with any arbitrary window assigner). See the included test case, it uses sliding windows. |
Thank you for the explanation @drfloob. The Connected Components example is indeed tightly coupled to the WindowGraphAggregation class. In fact, the idea is to showcase window graph aggregation usage. I think the way to go in your case would be to create a new example or even a new abstraction to expose the contents of a sliding window as a graph snapshot. This way it would be more general than aggregation and would allow us to do any kind of operation on the window contents. What do you think? |
@vasia That makes a lot of sense, it seems there's no need for this PR. I'm not sure how to build this more general abstraction at the moment, I'll need to get more familiar with the project. Do you already have an architecture in mind, or any suggestions as to where this new abstraction would live? Also, if I understand correctly, I believe the changes we're talking about would fix #2: enabling computation over snapshots from arbitrary windowing models. Is that right? If not, there's still some subtlety in #2 that I don't understand. |
Hi @drfloob, #2 is an old issue and doesn't really provide helpful information. If you'd like to work on this, maybe it's a good idea to open a new issue and we can discuss details there. |
This example shows a non-reducing connected components algorithm, where the components within each window are emitted independently, without being merged with other windows.
I've added another example as a unit test, along with a WindowConnectedComponents library class that better showcases the specific use case. It spares quite a bit of redundant code compared to the alternative. |
Fixes #2 (mostly). I did not try tuple-based windowing, I don't think flink itself can do it very efficiently. Tumbling and Sliding windows both work well.