support IFNULL function
Is your feature request related to a problem or challenge?
https://docs.databend.com/sql/sql-functions/conditional-functions/ifnull
I want implement IFNULL function, As implemented by databend
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
cc @alamb , Is it necessary to implement this function? if yes I will do it
~~There's nullif already: https://arrow.apache.org/datafusion/user-guide/sql/scalar_functions.html#nullif~~
~~Could add ifnull as an alias if there's need for it I suppose~~ :thinking:
Edit: ah my mistake, seems nullif does something different than ifnull
TLDR I think implementing this function (perhaps call it nvl and add an alias to ifnull) would be a good addition. Thank you @guojidan
I thought DataFusion already supported the NVL function but I guess I was remembering the Nan equivalent of nanvl: https://arrow.apache.org/datafusion/user-guide/sql/scalar_functions.html#nanvl
So the steps are something like:
- add function
- add sqllogictests
- add doc entries
Should be a good feature 🏆
Can you please implement it as a ScalarUDF in https://github.com/apache/arrow-datafusion/tree/main/datafusion/functions/src/core (following the model of nullif) rather than adding to BuiltInFunction?