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
[FLINK-8013] [table] Support aggregate functions with generic arrays #5011
Conversation
import org.apache.flink.table.api.Types | ||
|
||
/** | ||
* User-defined aggregation function to compute the TOP 10 most visited pages. |
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.
Adjust the comment:
User-defined aggregation function to compute the top 10 Int IDs with the highest Float values.
We use an Array[Tuple2[Int, Float]] as accumulator to store the top 10 entries.
@@ -55,7 +55,6 @@ object CollectionDataSets { | |||
data.+=((19, 6L, "Comment#13")) | |||
data.+=((20, 6L, "Comment#14")) | |||
data.+=((21, 6L, "Comment#15")) | |||
Random.shuffle(data) |
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.
I think this should be added back.
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.
No, the result of this shuffle is discarded. data
is not modified.
@@ -0,0 +1,107 @@ | |||
package org.apache.flink.table.utils |
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.
ASF header missing :-)
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.
Thanks for the PR @twalthr.
The fix looks good. I left a few comments that should be addressed before merging the PR.
Thanks, Fabian
Merging this... |
What is the purpose of the change
Adds supports for aggregate functions with generic arrays and fixes other bugs.
Brief change log
Verifying this change
Complex aggregation function added.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation