Richard-Durkee opened a new pull request, #56025:
URL: https://github.com/apache/spark/pull/56025

   ### What changes were proposed in this pull request?
   
   Add an auxiliary constructor to the `If` expression that accepts two 
arguments, defaulting `falseValue` to `Literal(null)`. This allows 
`IF(condition, value)` to return NULL when the condition is false.
   
   ### Why are the changes needed?
   
   The two-argument IF expression is supported by MySQL, Trino/Presto, and 
BigQuery. Users migrating queries from these systems currently get an arity 
error.
   
   ### Does this PR introduce any user-facing change?
   
   Yes. `IF(condition, value)` now returns `value` when true and NULL when 
false, instead of throwing an error.
   
   ### How was this patch tested?
   
   New golden file SQL test (`if-two-arg.sql`). Existing 
`conditional-functions.sql` and `ifCoercion.sql` tests pass with no regressions.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude 4


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