-
Notifications
You must be signed in to change notification settings - Fork 707
fix: single value should only accept at most one value #854
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #854 +/- ##
============================================
- Coverage 72.02% 71.96% -0.06%
Complexity 2766 2766
============================================
Files 927 927
Lines 54086 54139 +53
Branches 1787 1787
============================================
+ Hits 38953 38960 +7
- Misses 14243 14289 +46
Partials 890 890
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
xiangjinwu
left a comment
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.
What about impl Aggregator rather than reusing GeneralAgg? The extension in this PR means some state are captured in the GeneralAgg::result, and some in GeneralAgg::f. Can we keep f pure and capture all states explicitly in a struct that impl Aggregator?
|
As for 2-phase agg, the sub-counts from local results needs to be summed. An immature idea is to rewrite it like |
Let me try it 👌 .
You are suggesting this can be done purely in the frontend, do I get your point? Let's hold this PR for a while and seek other ones' opinion. |
|
@liurenjie1024 @fuyufjh @TennyZhuang @st1page What do you guys think? |
Yes, it is mostly frontend. I also prefer to error out earlier at local stage, but unsure if it is always possible. What if there is 1 null at each local node? The local node cannot call it an error yet, and the global one cannot differentiate this case with a correct empty result, without getting count from local. There may be better solutions. Just to complete the idea above, frontend rewrite will remove this special aggregate function, but it still need backend support for |
|
As @fuyufjh suggests, there could be a more general solution that uses other operators, i.e. join, to achieve this instead of a special Since we may remove this altogether later, the PR keeps the current implementation for the moment. And this issue will be investigated further. |
What's changed and what's your intention?
PLEASE DO NOT LEAVE THIS EMPTY !!!
Please explain IN DETAIL what the changes are in this PR and why they are needed:
As detected by @xiangjinwu in #831,
the previous implementation does not treat
nullas a value. However,single_valueaggregation should accept at most one value no matter the value is null or not. Therefore, we need a struct instead of a function to record the number of inputs as a null ofOptionhas already been interpreted as a null value.This PR partially reverts the changes made in #825 as
RTFnbecomes a trait that needs to be implemented again.Checklist
Refer to a related PR or issue link (optional)
#831