wombatu-kun opened a new pull request, #20230:
URL: https://github.com/apache/hudi/pull/20230

   ### Describe the issue this Pull Request addresses
   
   Closes #20229
   
   ### Summary and Changelog
   
   Data skipping no longer treats the start date of `datediff(end, start)` as 
order-preserving, so "last N days" filters such as `datediff(current_date(), 
dt) <= 7` stop pruning files that hold matching rows.
   
   - `BaseHoodieCatalystExpressionUtils`: drops the `DateDiff(_, col)` arm, 
since `datediff(end, start)` is `end - start` and reverses the ordering of 
`start`. The end-date arm `DateDiff(col, _)` stays.
   - Tests: `TestHoodieCatalystExpressionUtils` pins both argument positions, 
and `TestDataSkippingUtils` covers the start-date case next to an end-date 
control that still prunes.
   
   ### Impact
   
   Correctness fix: such queries could silently miss rows, through both the 
column stats and the partition stats index. Filters with the column as the 
start date no longer prune; the equivalent `dt >= date_sub(current_date(), 7)` 
still does.
   
   ### Risk Level
   
   low. It only removes pruning that was unsound. The new test cases fail 
without the fix, and the SQL repro from the issue returns the expected rows 
with it.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] 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
   


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