Uh oh!
There was an error while loading. Please reload this page.
branch-4.0: [fix](variant) Reject COUNT DISTINCT on variant arguments #63479 - #64294
Merged
Conversation
hello-stephen
commented
Jun 9, 2026
Contributor
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
hello-stephen
commented
Jun 9, 2026
Contributor
run buildall |
morningman
approved these changes
Jun 24, 2026
eldenmoon
commented
Jun 24, 2026
Member
run buildall |
ContributorAuthor
PR approved by at least one committer and no changes requested. |
ContributorAuthor
PR approved by anyone and no changes requested. |
Problem Summary: `COUNT(DISTINCT variant_subcolumn)` could reach BE hash key selection and fail with a vague `INTERNAL_ERROR` when the argument was `VARIANT`. This PR rejects `VARIANT` arguments during FE aggregate analysis, including grouped distinct aggregate plans before `DistinctAggregateRewriter` can split the distinct aggregate. `COUNT(DISTINCT ...)` on `VARIANT` arguments now reports a clear unsupported-type error instead of a BE internal error. Cast `VARIANT` expressions to `STRING` or another supported scalar type before using `COUNT DISTINCT`. - Test: Unit Test / Build / Regression Test - `./run-fe-ut.sh --run org.apache.doris.nereids.trees.expressions.functions.agg.CountTest` - `./build.sh --fe` - `./run-regression-test.sh --run --conf tmp/regression-conf.auto.groovy -d correctness_p0 -s test_array_order_by` - `./run-regression-test.sh --run --conf tmp/regression-conf.auto.groovy -d correctness_p0 -s test_array_string_order_by` - `./run-regression-test.sh --run --conf tmp/regression-conf.auto.groovy -d variant_p0 -s test_variant_count_distinct` - `git diff --check` - Behavior changed: Yes. `COUNT DISTINCT` on `VARIANT` now fails during analysis with a clearer error instead of a BE `INTERNAL_ERROR`. - Does this need documentation: No
morningmanforce-pushed
the
auto-pick-63479-branch-4.0
branch
from
June 24, 2026 09:46
00f829b to
4049fa9Comparemorningman
commented
Jun 24, 2026
Contributor
run buildall |
morningman
approved these changes
Jun 24, 2026
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #63479