-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix: scalar aggregation engine primitive #10465
Conversation
Signed-off-by: Harshit Gangal <[email protected]>
… scalar aggregation Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
Signed-off-by: Florent Poinsard <[email protected]>
dispOrigOp := "" | ||
if ap.OrigOpcode != AggregateUnassigned && ap.OrigOpcode != ap.Opcode { | ||
dispOrigOp = "_" + ap.OrigOpcode.String() | ||
} | ||
if ap.Alias != "" { | ||
return fmt.Sprintf("%s(%s) AS %s", ap.Opcode.String(), keyCol, ap.Alias) | ||
return fmt.Sprintf("%s%s(%s) AS %s", ap.Opcode.String(), dispOrigOp, keyCol, ap.Alias) | ||
} | ||
return fmt.Sprintf("%s(%s)", ap.Opcode.String(), keyCol) | ||
return fmt.Sprintf("%s%s(%s)", ap.Opcode.String(), dispOrigOp, keyCol) |
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 the plans would be more readable if we had a field that contains the original op code to the description instead of suffixing the original op code to the current op code. I don't have strong opinions though, the current change works well too imo.
* test: added failing e2e test Signed-off-by: Harshit Gangal <[email protected]> * fix: handle empty row for scalar aggregation and also olap engine for scalar aggregation Signed-off-by: Harshit Gangal <[email protected]> * test: update plan test output Signed-off-by: Harshit Gangal <[email protected]> * test: e2e test for empty rows in non-scalar aggregates Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Florent Poinsard <[email protected]>
* test: added failing e2e test Signed-off-by: Harshit Gangal <[email protected]> * fix: handle empty row for scalar aggregation and also olap engine for scalar aggregation Signed-off-by: Harshit Gangal <[email protected]> * test: update plan test output Signed-off-by: Harshit Gangal <[email protected]> * test: e2e test for empty rows in non-scalar aggregates Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Florent Poinsard <[email protected]> Co-authored-by: Florent Poinsard <[email protected]>
Description
This PR fixes two bugs in scalar aggregation engine primitive
This was caused when we moved from using AggregateSum over AggregateCount as opcode for count(*). As the actual operation at the engine primitive level was sum of count, this caused a negative effect of returning
NULL
for empty row instead of0
.Related Issue(s)
Checklist
Deployment Notes