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

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   ### Release note
   
   BE crashes with SIGABRT (vector out-of-bounds) in 
`FileScanner::_generate_partition_columns()` when scanning Iceberg or Paimon 
partitioned tables.
   
   Root cause: `_partition_slot_index_map` is built once from the first scan 
range's `columns_from_path_keys`, but different ranges may have different 
`columns_from_path` sizes due to:
   
   1. **Iceberg partition evolution**: Tables evolving from non-identity 
transforms (e.g., `day(ts)`) to identity transforms (`ts`). 
`IcebergUtils.getPartitionInfoMap()` returns null for non-identity transforms, 
so `setIcebergParams()` leaves `columnsFromPath` as an empty list for those 
ranges while populating it for identity-transform ranges.
   
   2. **Paimon mixed reader paths**: Native reader splits (Parquet/ORC) call 
`setPaimonPartitionValues(partitionInfoMap)`, but JNI scanner splits (for 
merge-required or unsupported-format data) skip this call entirely, leaving 
`paimonPartitionValues` as null.
   
   The root cause is that `createFileRangeDesc()` unconditionally called 
`setColumnsFromPath([])` for all ranges, setting the Thrift `__isset` flag to 
true even with an empty list. When BE sees `__isset=true`, it enters the 
partition column loop and crashes on out-of-bounds access for ranges that were 
never populated with actual partition values.
   
   Fix:
   
   - **FileQueryScanNode.createFileRangeDesc()**: Only call 
`setColumnsFromPath()` and `setColumnsFromPathKeys()` when 
`columnsFromPathKeys` is non-empty. This keeps `__isset=false` for 
Iceberg/Paimon ranges that have no path-derived partition keys, so BE skips 
partition column generation entirely for those ranges. Ranges that do have 
partition values (set later by `setIcebergParams`/`setPaimonParams`) work 
correctly since they explicitly call `setColumnsFromPath()` with actual values.
   - **PaimonScanNode**: Additionally set partition values on JNI scanner 
splits (previously missing), enabling runtime filter partition pruning for JNI 
splits.
   
   Fix a BE crash (SIGABRT) that could occur when querying Iceberg tables with 
partition evolution or Paimon tables with mixed-format data splits.
   
   ### 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: 
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