-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 v1 query engine behavior for aggregations without group by where the limit is zero #13564
Conversation
…the limit is zero
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13564 +/- ##
============================================
+ Coverage 61.75% 62.09% +0.34%
+ Complexity 207 198 -9
============================================
Files 2436 2559 +123
Lines 133233 140935 +7702
Branches 20636 21870 +1234
============================================
+ Hits 82274 87518 +5244
- Misses 44911 46794 +1883
- Partials 6048 6623 +575
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
For aggregation function without group-by, we should be able to short circuit it on the broker side and always get the correct data schema.
For selection/group-by, ideally we also want to short circuit on the broker side since schema is already enforced. One missing piece is to derive the transform result type based on the input type.
You may also take a look at #13057 and we can probably solve them together.
@jackjlli - Can you help review this please ? |
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.
+1 on regardless of whether it's an aggregate query, selection query, order-by query or not, if the limit is set to 0, we can always short circuit it on broker side to fail fast.
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.
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.
GROUP BY
clauses typically aren't used with aLIMIT
clause since it semantically doesn't make sense.LIMIT
is - except if theLIMIT
is 0, in which case an empty result set is returned.LIMIT
is (even if it is 0).EmptyAggregationOperator
(somewhat similar to the EmptySelectionOperator):testGroupByAggregationWithLimitZero
recently added in Fix issue with group by combine operator when limit is zero #13555 is updated because the integration test actually doesn't do any comparison for aggregation group by queries without an order by clause (also in this case we just want to verify that 0 rows are returned and that the data schema is still returned) -pinot/pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/ClusterIntegrationTestUtils.java
Lines 812 to 817 in efa4300