peterxcli opened a new pull request, #25034:
URL: https://github.com/apache/datafusion/pull/25034

   ## Which issue does this PR close?
   
   Closes #24614.
   
   ## Rationale for this change
   
   A binary expression configured to fail on arithmetic overflow silently wraps 
after a protobuf round trip. For example, checked `Int32::MAX + 1` returns an 
error before serialization but returns `Int32::MIN` after decoding.
   
   ## What changes are included in this PR?
   
   - Preserve `BinaryExpr::fail_on_overflow` in the protobuf schema and both 
the flattened and legacy `l/r` decoders. Only flatten chains whose operator and 
overflow policy match.
   - Exhaustively destructure the encoder and decoder fields for `BinaryExpr`, 
`LikeExpr`, and `SqlSimilarToPattern`, making future field additions require an 
explicit serialization decision.
   - Regenerate the Rust protobuf and JSON bindings.
   - Correct a two-line borrowing lint in the PostgreSQL SQLLogicTest decimal 
formatter so the required full-workspace Clippy check passes.
   
   ## What is the testing strategy for this PR?
   
   - Added `roundtrip_binary_expr_overflow`, covering all four combinations of 
checked/wrapping inner and outer additions and asserting evaluated results. 
Verified it fails before the fix: checked overflow decodes to 
`Int32(-2147483648)`.
   - Added `roundtrip_binary_expr_overflow_legacy`, covering legacy messages 
without the new field and JSON preservation of the checked policy.
   - All 17 focused physical-expression round-trip tests passed.
   - The extended workspace test command passed: 11,260 Rust tests passed, 8 
ignored, and all 511 SQLLogicTest files completed.
   - `cargo fmt --all` and `cargo clippy --all-targets --all-features -- -D 
warnings` passed. Both conversion tests passed with the PostgreSQL feature 
enabled after the borrowing cleanup.
   - The complete `./dev/rust_lint.sh` suite passed, including formatting, 
Clippy, TOML formatting, license headers, typos, documentation formatting, 
workflow checks, and the documentation build.
   
   ## Are there any user-facing changes?
   
   Checked arithmetic retains its overflow errors after serialization, 
including chains with mixed overflow policies. Messages without the new field 
retain their previous wrapping behavior.
   


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