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-5915] [table] forward the entire aggregate ArgList to aggregate runtime functions #3647
Conversation
@@ -857,28 +857,30 @@ object AggregateUtil { | |||
aggregateCalls: Seq[AggregateCall], | |||
inputType: RelDataType, | |||
needRetraction: Boolean) | |||
: (Array[Int], Array[TableAggregateFunction[_ <: Any]]) = { | |||
: (Array[util.List[Integer]], Array[TableAggregateFunction[_ <: Any]]) = { |
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.
Can we use an Array[Int]
instead of a List[Integer]
?
Scala Int
is compiled to Java int
primitive. java.lang.Integer
is a boxed type.
Also an array access is faster than a List.get()
access (ArrayList.get()
would be a bit better).
The change looks good in general. I'd prefer to use an array instead of a List though. |
…e runtime functions
128479c
to
87b2a61
Compare
Thanks @fhueske, I overlooked a list is not always an arraylist. I change it to scala array, but keep the type as integer, as this is type returned (and not easy to be casted to Int) from aggregateCall.getArgList. I updated PR and also rebased to the master (as I noticed there are a few over aggregates have been recently merged), so it will be easier for you to merge. |
Thanks @shaoxuan-wang, I found a way to cast the Thanks, Fabian |
…ate runtime functions. This closes apache#3647.
…ate runtime functions. This closes apache#3647.
…ate runtime functions. This closes apache#3647.
…ate runtime functions. This closes apache#3647.
This PR partially solved "FLINK-5915 Add support for the aggregate on multi fields".
The roadmap of UDAGG would be 1. codeGen all the runtime aggregate functions; 2. add UDAGG tableAPI interface.
I would like to kick this PR off earlier as: a) we can finalize the runtime function while doing the codeGen; b) as more and more (over) aggregates are implemented, it would be good if we can finalize the interface and share library to the stage (as we planned) as earlier as possible.
Note that: though the entire aggregate ArgList is forwarded to the runtime function, for the functions that have not been codeGened, we will still support only one column aggregate input.
Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the How To Contribute guide.
In addition to going through the list, please provide a meaningful description of your changes.
General
Documentation
Tests & Build
mvn clean verify
has been executed successfully locally or a Travis build has passed