yjshen commented on PR #5911:
URL: 
https://github.com/apache/arrow-datafusion/pull/5911#issuecomment-1501536412

   Hi @allenma! Thanks for the contribution! ❤️ 
   
   Several thoughts from my side:
   1. What do you think if we make `If` a new expr type? Expr might be more 
flexible than the built-in function so that we could achieve some short-circuit 
optimizations. (We could avoid evaluating the whole false_val array if the 
condition boolean array is mostly true)
   2. What do you think if we make the `if` expression a syntax sugar for the 
`case when` and rewrite it during the analyzer? We could easily have both 
short-circuit and type-coercion for `if`. Is there something special case that 
is not handled by `case when` or something else I'm not aware of?


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

Reply via email to