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

   ## Which issue does this PR close?
   
   Closes #16054
   
   ## Rationale for this change
   
   Expression formatting like `(1+2)*3` displays as `Int64(1) + Int64(2) * 
Int64(3)`, losing parentheses and misrepresenting precedence in column headers 
and EXPLAIN output.
   
   ## What changes are included in this PR?
   
   - `SchemaDisplay` and `SqlDisplay` for `BinaryExpr` now wrap nested 
`BinaryExpr` children in parentheses (unconditional/DuckDB-style approach as 
discussed in the issue)
   - Updated 3 test snapshots
   
   ## Are these changes tested?
   
   Partially. Rust crate tests pass, but 6 SLT tests fail due to 
`optimize_projections` schema mismatches — when projection merging restructures 
expression trees, the unconditional parenthesization produces different 
`schema_name()` strings for semantically equivalent expressions. Opening as 
draft to get feedback on the right approach.
   
   ## Are there any user-facing changes?
   
   Column headers and EXPLAIN output will include parentheses around nested 
binary sub-expressions.


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