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

Fix the issue of unexpected results generated by groupBy queries when containing subqueries.#17598 #17599

Closed
wants to merge 3 commits into from

Conversation

soullkk
Copy link
Contributor

@soullkk soullkk commented Jan 1, 2025

Fixes the issue of unexpected results generated by groupBy queries when containing subqueries#17598 .

Description

When processing groupby subqueries, it is necessary to finalize the returned results by the subqueries to support the aggregation operation of results by outer queries.

Fixed the bug that unexpected results generated by groupBy queries when containing subqueries.

When the groupBy subquery uses the longLast aggregator, the returned result is similar to Pair{lfs=xxx, lrs=xxx}, and it needs to be fanalized to support longSum or other aggregation operations in the outer groupBy query.

Before executing the outer aggregator, like longSum, the results of the subquery need to be transformed as follows:

  • Pair{lfs=xxx, lrs=###} -> ###

Key changed/added classes in this PR
  • GroupByQueryQueryToolChest.java

This PR has:

  • been self-reviewed.
  • 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
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

soullkk added 3 commits April 16, 2024 22:50
# Conflicts:
#	indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java
@soullkk soullkk closed this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant