Amogh-2404 opened a new pull request, #24668:
URL: https://github.com/apache/datafusion/pull/24668

   ## Which issue does this PR close?
   
   - Closes #24665.
   
   ## Rationale for this change
   
   `Expr::Negative` represents unary minus, but the simplifier applied 
identities for bitwise NOT. This produced wrong results in bitwise expressions 
and could hide signed-integer overflow when removing double negation.
   
   ## What changes are included in this PR?
   
   - Remove the bitwise-complement and De Morgan rewrites for `Expr::Negative`.
   - Remove the helpers used only by those rewrites.
   - Replace the invalid unit expectations with preservation tests and add an 
end-to-end regression in `scalar.slt`.
   
   ## Are these changes tested?
   
   Yes. Unit tests cover both operand orders for AND, OR, and XOR, the two De 
Morgan shapes, and double negation. `scalar.slt` checks the resulting values 
end to end.
   
   ## Are there any user-facing changes?
   
   Yes. Unary minus in bitwise expressions now returns the correct results, and 
double negation preserves overflow behaviour. There are no API changes.
   


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