cshuo opened a new pull request, #20451:
URL: https://github.com/apache/hudi/pull/20451

   ### Describe the issue this Pull Request addresses
   
   Closes #20443
   
   A Spark time travel query can lose matching rows when latest-snapshot 
partition statistics have narrowed past a value in the requested historical 
snapshot. For example, after a value changes from 10 to 50, pruning a 
historical `value = 10` query using the latest `[50, 50]` partition bounds 
skips the matching partition.
   
   ### Summary and Changelog
   
   - Skip partition-statistics pruning for historical snapshots using 
`PartitionStatsIndexSupport.supportsQueryType`, including the expression index 
partition-statistics fallback.
   - Preserve partition-predicate pruning and statistics pruning for the latest 
snapshot.
   - Add COW and MOR regression coverage for historical reads and 
latest-snapshot pruning.
   
   ### Impact
   
   Time travel queries avoid incorrect partition pruning. Historical queries 
may scan more partitions when data skipping is enabled.
   
   ### Risk Level
   
   Low: the change conservatively disables partition-statistics pruning for 
historical snapshots. The regression test reproduces the missing row on both 
COW and MOR before the fix and passes after it. The full `TestTimeTravelQuery` 
suite passed (14 tests), as did the Scala style check.
   
   ### Documentation Update
   
   None.
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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