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

   ## Which issue does this PR close?
   
   - Closes #27419.
   
   ## Rationale for this change
   
   `EquivalenceGroup::exprs_equal` could incorrectly consider expressions with 
different operators equivalent. For example, `a + 5` and `a % 5` could compare 
as equal because their expression types and children matched even though their 
operators differed.
   
   ## What changes are included in this PR?
   
   The expression comparison now checks attributes stored on the expression 
itself before recursively comparing its children.
   
   This distinguishes expressions with different operators or cast target types 
while preserving the existing behavior that allows children belonging to the 
same equivalence class to match.
   
   Focused regression coverage includes:
   
   - Identical expressions.
   - Binary expressions with different operators.
   - Different operators whose operands are equivalent through an 
`EquivalenceGroup`.
   - Cast expressions with different target types.
   
   ## What is the testing strategy for this PR?
   
   The existing `test_exprs_equal` coverage was extended with focused 
regression cases.
   
   The following validation passed:
   
   - Focused equivalence tests.
   - Narrowly related range-partition tests.
   - `cargo fmt --all -- --check`.
   - `cargo clippy --all-targets --all-features -- -D warnings`.
   - The repository-required extended workspace test suite.
   
   ## Are there any user-facing changes?
   
   Yes. Expression equivalence checks no longer treat expressions with 
different operators or other non-child attributes as equivalent.
   
   There are no public 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