morrySnow opened a new pull request, #68072:
URL: https://github.com/apache/doris/pull/68072
### What problem does this PR solve?
Related PR: #65530
Problem Summary:
Backport the TopN lazy-materialization slot-preservation fix to branch-4.1.
An output alias must remain eager when its base slot is already required
eagerly by TopN, and Filter pruning must remove only the slots actually
selected for lazy materialization rather than every predicate input slot.
The alias fix is adapted to branch-4.1's older lazy-materialization
implementation by using its existing eager-output set directly, without
bringing in unrelated later refactoring.
### Release note
Fix invalid plans caused by pruning slots still required by TopN lazy
materialization.
### Check List (For Author)
- Test
- [x] Unit Test
- [x] Regression test coverage included
- Behavior changed:
- [x] Yes. Slots required by TopN ordering remain eagerly materialized.
- Does this need documentation?
- [x] No.
Test details:
- `LazyMaterializeTopNTest` and `LazySlotPruningTest`: 2 tests passed.
- Full FE Maven reactor: `BUILD SUCCESS`.
### 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]