-
Notifications
You must be signed in to change notification settings - Fork 10
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
Implement aggregate on windows. #23
base: main
Are you sure you want to change the base?
Conversation
it("should apply aggregation based on Monoid") { | ||
val env = FlinkExecutor.newEnv(parallelism = 1) | ||
val stream = env.fromCollection((1 to 200).toList.map(_ => 1)) | ||
implicit val semigroup = new Monoid[Int] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implicit val monoid
typeInformation: TypeInformation[O]): DataStream[O] = { | ||
val reducer = new AggregateFunction[T, A, O] { | ||
|
||
override def createAccumulator(): A = Monoid.empty[A] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though this sounds like a good idea, I have never used a Monoid in practice because Monoid.empty[A]
lacks the context of a key (that's needed to do anything meaningly aggregation at scale).
If you find it useful though, happy to have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna remove that as it seems it doesn't make that much sense.
|
Converting to Draft as I need to think a little bout how to model that best. |
Attempt to implement
aggregate
on windows usingMonoid
for some simplicity.I'm not too convinced about using the
Monoid
there so I'm happy to discuss that.