Skip to content
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

Uses primitive accumulator for min and max, and backports CountGroupsAccumulator #178

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

srh
Copy link
Member

@srh srh commented Nov 27, 2024

The Count GroupsAccumulator actually can't be made with PrimitiveGroupsAccumulator, and making an adapted version of PrimitiveGroupsAccumulator was sufficiently annoying, that a backported version of CountGroupsAccumulator as we have here works well enough.

*x = (*x).max(y);
},
)
.with_starting_value(<$T as ArrowPrimitiveType>::Native::MIN),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Cubestore running on the upstream DF branch we do see this issue with groups accumulators and different behavior with regular accumulators.

mysql> SELECT MAX(column3) FROM (VALUES (1, 2, NULL), (4, 5, '-Infinity'::double precision));
+--------------+
| max(column3) |
+--------------+
| -inf         |
+--------------+
1 row in set (0.00 sec)

mysql> SELECT MAX(column3) FROM (VALUES (1, 2, NULL), (1, 5, '-Infinity'::double precision)) GROUP BY column1;
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| max(column3)                                                                                                                                                                                                                                                                                                           |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| -179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

@srh srh merged commit 8d4663b into cube Nov 27, 2024
13 of 15 checks passed
@srh srh deleted the groups-accumulator-primitive-other-types branch November 27, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants