You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "yjshen (via GitHub)" <gi...@apache.org> on 2023/04/10 08:11:51 UTC

[GitHub] [arrow-datafusion] yjshen commented on pull request #5911: Add if function support

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org