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

   ### Describe the issue this Pull Request addresses
   
   Refs #19445 (split out of #19475)
   
   Data skipping treats `Multiply` and `Divide` as order-preserving and 
re-applies them to a column's min/max stats. Both arms matched any factor. A 
negative constant reverses the ordering, so the translated bound prunes files 
holding matching rows: for `A` in `[-10, 0]`, `A * -1.0 < 5.0` translates to 
`A_minValue * -1.0 < 5.0`, i.e. `10 < 5`, although `A = 0` matches.
   
   ### Summary and Changelog
   
   - `BaseHoodieCatalystExpressionUtils.OrderPreservingTransformation`: the 
`Multiply` / `Divide` arms now require a strictly positive numeric literal 
factor. Negative, zero, NaN, null and non-literal factors fall back to no 
pruning. The optimizer folds constant factors to literals before data skipping 
runs, so requiring a `Literal` costs nothing in practice.
   - Tests: `TestHoodieCatalystExpressionUtils` covers the rejected and 
accepted factors; `TestDataSkippingUtils` adds negative multiply/divide repros 
and positive multiply/divide pruning controls.
   
   Integral overflow with a positive factor (`Long.MaxValue * 2L` wraps to 
`-2`) is a separate class, fixed in #TBD together with Add and ShiftLeft.
   
   ### Impact
   
   No public API change. Filters that multiply or divide a column by a 
non-positive constant no longer prune.
   
   ### Risk Level
   
   low. The only new behavior is falling back to no pruning.
   
   ### 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