leaves12138 opened a new pull request, #7953:
URL: https://github.com/apache/paimon/pull/7953

   ### Purpose
   Fix BTree global index building for data-evolution append tables when a data 
split contains unordered data files or intersects multiple discontiguous row 
ranges.
   
   Previously `DataEvolutionBatchScan.wrap` derived the split range from the 
first and last data files. This assumes `dataFiles()` are ordered by row id, 
but `RangeHelper.mergeOverlappingRanges` may keep the original order inside a 
merged group. As a result, `wrap` could calculate an inverted range and fail to 
find any intersected row ranges.
   
   Also, BTree index building assumed each split maps to exactly one row range 
after applying the row range index. A contiguous data-file split can still 
intersect multiple discontiguous indexed/non-indexed row ranges, so the builder 
needs to fan out the split by row range before grouping.
   
   ### Changes
   - Compute `IndexedSplit` row ranges by intersecting the row range index with 
each data file's actual row-id range, then sort/merge the result.
   - Add `calcRowRangesWithRowIndex` and let BTree range grouping handle 
multiple row ranges from one split.
   - Wrap each row range as a single-range `IndexedSplit` so downstream reads 
push down the exact row range.
   - Add regression tests for unordered data files and discontiguous row ranges.
   
   ### Tests
   - `mvn -pl paimon-core -Pfast-build spotless:apply`
   - `mvn -pl paimon-core -Pfast-build -DskipTests compile`
   - `mvn -pl paimon-core -Pfast-build -DfailIfNoTests=false 
-Dtest=DataEvolutionBatchScanTest#testWrapToIndexSplitsWithUnorderedDataFiles,BTreeGlobalIndexBuilderSplitTest#testGroupSplitsByDiscontiguousRowRangeIndex
 test`
   


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

Reply via email to