-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add nanvl builtin function #7171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great -- thank you very much @sarutak 🙏
Can you please also add an entry to the user guide about this function https://github.com/apache/arrow-datafusion/blob/main/docs/source/user-guide/sql/scalar_functions.md#atan2 ?
We don't yet have automated documentation I am afraid (#3092)
|
||
# nanvl | ||
query RRR | ||
SELECT nanvl(asin(10), 1.0), nanvl(1.0, 2.0), nanvl(asin(10), asin(10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for testing when both args are NAN
@alamb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank. you @sarutak
Which issue does this PR close?
Closes #7170
Rationale for this change
I propose to add
nanvl
builtin function which is provided by some RDBMS.nanvl(x, y)
returnsx
ifx
is notNaN
otherwise returnsy
.It could be convenience to handle missing data.
What changes are included in this PR?
nullvl
is added as a math builtin function.Are these changes tested?
Added new tests.
Are there any user-facing changes?
New builtin function is added but it doesn't break compatibility.