You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "LakshSingla (via GitHub)" <gi...@apache.org> on 2023/04/04 09:24:09 UTC
[GitHub] [druid] LakshSingla opened a new pull request, #14022: Fix the order of aggregator finalization in GroupByPostShuffleFrameProcessor (MSQ)
LakshSingla opened a new pull request, #14022:
URL: https://github.com/apache/druid/pull/14022
### Description
Fixes the order in which the row's results are finalized in the `GroupByPostShuffleFrameProcessor`. This fixes the bug which prevents the queries containing a `HAVING` clause with complex aggregators from executing.
```sql
SELECT count(distinct __time)
FROM foo
GROUP BY c1
HAVING count(distinct __time) > 5
```
The bug arises because `DimFilterHavingSpec` expects the unfinalized rows to check if the row passes the `HAVING` clause (it finalizes it internally), however in the `GroupByPostShuffleFrameProcessor`, we finalize the rows before that.
###### NOTE
This should also allow the following test cases to pass, however, they are not enabled due to the null handling discrepancy in the MSQ test cases:
```
CalciteQueryTest#testHavingOnApproximateCountDistinct()
CalciteQueryTest#testHavingOnExactCountDistinct
```
<!-- Describe the goal of this PR, what problem are you fixing. If there is a corresponding issue (referenced above), it's not necessary to repeat the description here, however, you may choose to keep one summary sentence. -->
<!-- Describe your patch: what did you change in code? How did you fix the problem? -->
<!-- If there are several relatively logically separate changes in this PR, create a mini-section for each of them. For example: -->
#### Release note
<!-- Give your best effort to summarize your changes in a couple of sentences aimed toward Druid users.
If your change doesn't have end user impact, you can skip this section.
For tips about how to write a good release note, see [Release notes](https://github.com/apache/druid/blob/master/CONTRIBUTING.md#release-notes).
-->
<hr>
##### Key changed/added classes in this PR
* `GroupByPostShuffleFrameProcessor`
<hr>
This PR has:
- [x] been self-reviewed.
- [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [x] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
- [ ] added integration tests.
- [x] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] cryptoe commented on pull request #14022: Fix the order of aggregator finalization in GroupByPostShuffleFrameProcessor (MSQ)
Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe commented on PR #14022:
URL: https://github.com/apache/druid/pull/14022#issuecomment-1495961866
Should we wait for https://github.com/apache/druid/pull/14020/files to enable `CalciteQueryTest#testHavingOnApproximateCountDistinct()` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] LakshSingla commented on pull request #14022: Fix the order of aggregator finalization in GroupByPostShuffleFrameProcessor (MSQ)
Posted by "LakshSingla (via GitHub)" <gi...@apache.org>.
LakshSingla commented on PR #14022:
URL: https://github.com/apache/druid/pull/14022#issuecomment-1496815573
+1 to @gianm . That PR will also unblock the migration of other test cases as well, so we would require a follow-up PR regardless. We can club these tests then.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] cryptoe merged pull request #14022: Fix the order of aggregator finalization in GroupByPostShuffleFrameProcessor (MSQ)
Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe merged PR #14022:
URL: https://github.com/apache/druid/pull/14022
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org