1cbyc opened a new pull request, #26311:
URL: https://github.com/apache/datafusion/pull/26311

   ## Which issue does this PR close?
   
   - Closes #26295.
   
   ## Rationale for this change
   
   When a simple CASE operand or ELSE branch cannot be unparsed, the unparser 
currently drops that child and returns valid-looking SQL with different 
semantics. Callers should receive the original unparse error instead.
   
   ## What changes are included in this PR?
   
   Propagate errors from CASE operands and ELSE branches, matching the existing 
WHEN/THEN behavior. Add regression coverage for both paths.
   
   ## What is the testing strategy for this PR?
   
   - `cargo test -p datafusion-sql --lib` (95 passed)
   - `cargo clippy -p datafusion-sql --all-targets --all-features -- -D 
warnings`
   - `cargo fmt --all --check`
   
   The regression test was also run against the pre-fix implementation and 
failed because unparsing returned a CASE AST instead of an error.
   
   ## Are there any user-facing changes?
   
   Yes. CASE expressions with unsupported operands or ELSE branches now return 
an error instead of producing SQL with altered semantics.


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