Skip to content

branch-4.0: [fix](nereids) Fix not in aggregate's output err after eliminate by uniform when group sets exist #56942 - #57744

Closed
github-actions[bot] wants to merge 1 commit into
branch-4.0from
auto-pick-56942-branch-4.0
Closed

branch-4.0: [fix](nereids) Fix not in aggregate's output err after eliminate by uniform when group sets exist #56942#57744
github-actions[bot] wants to merge 1 commit into
branch-4.0from
auto-pick-56942-branch-4.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #56942

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen

Copy link
Copy Markdown
Contributor

run buildall

…niform when group sets exist (#56942)
Fix not in aggregate's output err after eliminate by uniform when group
sets exist
if query as following, would cause `ERROR 1105 (HY000): errCode = 2,
detailMessage = GROUPING_PREFIX_event_name_group not in aggregate's
output`
the pr fix this
```sql
SELECT
CASE WHEN GROUPING(event_date) = 1 THEN '(TOTAL)' ELSE CAST(event_date AS VARCHAR) END AS event_date,
user_id,
MAX(conversion_level) AS conversion_level,
CASE WHEN GROUPING(event_name_group) = 1 THEN '(TOTAL)' ELSE event_name_group END AS event_name_group
FROM
(
SELECT
src.event_date,
src.user_id,
WINDOW_FUNNEL(
3600 * 24 * 1,
'default',
src.event_time,
src.event_name = 'shop_buy',
src.event_name = 'shop_buy'
) AS conversion_level,
src.event_name_group
FROM
(
SELECT
CAST(etb.`@dt` AS DATE) AS event_date,
etb.`@event_name` AS event_name,
etb.`@event_time` AS event_time,
etb.`@event_name` AS event_name_group,
etb.`@user_id` AS user_id
FROM
`test_event` AS etb
WHERE
etb.`@dt` between '2025-09-03 02:00:00' AND '2025-09-10 01:59:59'
AND etb.`@event_name` = 'shop_buy'
AND etb.`@user_id` IS NOT NULL
AND etb.`@user_id` > '0'
) AS src
GROUP BY
src.event_date,
src.user_id,
src.event_name_group
) AS fwt
GROUP BY
GROUPING SETS (
(user_id),
(user_id, event_date),
(user_id, event_name_group),
(user_id, event_date, event_name_group)
);
```
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #43391 Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
@yiguolei
yiguoleiforce-pushed the auto-pick-56942-branch-4.0 branch from 116cddb to d571b62CompareNovember 8, 2025 12:42
@yiguolei

Copy link
Copy Markdown
Contributor

run buildall

@seawinde

seawinde commented Nov 10, 2025

Copy link
Copy Markdown
Member

this compile fail, picked by another pr #57869

@morrySnow
morrySnow deleted the auto-pick-56942-branch-4.0 branch August 31, 2026 06:58
Sign up for freeto 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.

4 participants

@hello-stephen@yiguolei@seawinde@dataroaring