mrhhsg opened a new pull request, #67205:
URL: https://github.com/apache/doris/pull/67205

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #64242
   
   Problem Summary:
   
   TopN lazy materialization can fetch a nested-pruned column by row ID after 
the scan has reduced its child layout. On branch-4.1, the materialization probe 
may remap to a slot without the relation's access-path metadata, and the 
row-store fetch path cannot honor nested access paths. That can make the 
storage iterator layout disagree with the pruned result column layout.
   
   This backport:
   
   - preserves relation access paths through the lazy-materialization output;
   - routes nested lazy slots away from row-store fetch;
   - applies the slot access paths before branch-4.1's per-row 
`seek_and_read_by_rowid` calls;
   - keeps the parent struct iterator readable while skipped child iterators 
are marked individually.
   
   The FE output-slot propagation is included because master already had that 
prerequisite when #64242 merged, while branch-4.1 does not.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [x] Unit Test
           - `./run-fe-ut.sh --run 
org.apache.doris.nereids.processor.post.materialize.MaterializeProbeVisitorTest`
 (5 tests passed)
       - [x] Manual test (add detailed scripts or steps below)
           - Executed the nested STRUCT/MAP TopN lazy-rowid reproduction on the 
branch-4.1 adapted backport with `topn_lazy_materialization_threshold=1024`.
           - The query returned the expected primary keys `25, 21, 17, 13, 9`, 
and the BE remained alive.
       - [ ] 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?  -->
   
   A full current-head BE rebuild was attempted but was blocked by stale local 
Lance C++ third-party headers (`LanceScanStatistics` is missing from the 
installed headers). It is not counted as validation; CI is still required.
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. Nested-pruned lazy columns use the normal storage rowid fetch 
path instead of row-store fetch.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/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 -->
   


-- 
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]

Reply via email to