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-11706] Add the SumFunction to support KeyedStream.sum with field which is a vector #7786
[FLINK-11706] Add the SumFunction to support KeyedStream.sum with field which is a vector #7786
Conversation
- add ArraySum in SumFucntion to support KeyedStream.sum with the field which is array. - add unit test in AggregationFunctionTest and DataStreamTest
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. Bot commandsThe @flinkbot bot supports the following commands:
|
My personal Travis test passed(https://travis-ci.org/wangpeibin713/flink/builds/496369161) |
@wangpeibin713 thank you for your contribution, but I think this is not needed. I think |
@klion26 thanks for your review. I think this pr will help the user to sum the value for convenience. with In my opinion, It's too heavy for user. And When the length of the Integer[] changed, we have to change the Tuple4 to TupleX in java code ? If I make some mistake with your review. please let me know. Thanks very much. |
How about the below code
|
by the way, Sum Aggregator with multi fields with KeyedStream is also not supported now . |
with the flatmap function as your code, the output of the datastream (show as above) is :
output is expected to :
|
how about some code like below
|
After this transform function done, some function(maybe flatmap + keyBy + reduce ) should be called to combine the result value into Integer[]. It's not inconvenient for the developer. so I want to introduce this feature. It's transparent to developer.
|
Personally I don't like that semantic. Sum operation on array is not well defined. Some users could expect that result of plus on arrays should be concatenation of those. Therefore I am personally against introducing this feature. |
Closing this for now. If you still think it should go in, please reach consensus in the JIRA first. |
What is the purpose of the change
https://issues.apache.org/jira/browse/FLINK-11706
Brief change log
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
Documentation