HappenLee opened a new pull request, #68496:
URL: https://github.com/apache/doris/pull/68496
### What problem does this PR solve?
Issue Number: N/A
Queries such as `SELECT k, max_by_merge(s) FROM t GROUP BY k` over a
`GENERIC` aggregate-state column report `PREAGGREGATION: OFF` because the
value-column checker does not recognize aggregate state combinators. The scan
therefore retains the storage merge requirement even when the query aggregate
can merge the partial states.
Handle both `MergeCombinator` and `UnionCombinator` through a shared check
for `GENERIC` columns and matching nested function names. Keep the existing
bare-slot, filter, grouping, join and sibling-aggregate restrictions. Cover
multiple rowsets, `max_by` and non-idempotent `sum` states, NULL/empty inputs,
aliases, grouping and aggregate phases, plus negative plan cases.
### Release note
Enable scan pre-aggregation for compatible aggregate state merge and union
functions over GENERIC columns.
### Check List (For Author)
- Test:
- [x] Regression test: `agg_state_preagg`, `set_preagg`,
`test_agg_state` — 3/3 suites passed. The new suite's 14 output sections were
generated with `-forceGenOut` and passed a separate normal comparison run.
- [x] Unit Test: `SetPreAggStatusTest` — 13/13 passed.
- FE build and Checkstyle passed; source diff whitespace checks passed.
- Local SQL validation used the newly built FE and the existing ASAN BE
with `be_exec_version=14`; that BE does not support master's default version
15. No BE code changes or performance measurements are included.
- Behavior changed:
- [x] Yes. Compatible merge/union calls permit scan pre-aggregation.
Existing incompatible paths remain OFF.
- Does this need documentation?
- [x] No. No SQL syntax or function contract changes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]