You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "sarutak (via GitHub)" <gi...@apache.org> on 2023/08/01 19:36:16 UTC
[GitHub] [arrow-datafusion] sarutak opened a new pull request, #7171: Add nanvl builtin function
sarutak opened a new pull request, #7171:
URL: https://github.com/apache/arrow-datafusion/pull/7171
# 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)` returns `x` if `x` is not `NaN` otherwise returns `y`.
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.
--
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
[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #7171: Add nanvl builtin function
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #7171:
URL: https://github.com/apache/arrow-datafusion/pull/7171#discussion_r1281117730
##########
datafusion/core/tests/sqllogictests/test_files/math.slt:
##########
@@ -93,3 +93,9 @@ query RRRRRRR
SELECT atan2(2.0, 1.0), atan2(-2.0, 1.0), atan2(2.0, -1.0), atan2(-2.0, -1.0), atan2(NULL, 1.0), atan2(2.0, NULL), atan2(NULL, NULL);
----
1.107148717794 -1.107148717794 2.034443935796 -2.034443935796 NULL NULL NULL
+
+# nanvl
+query RRR
+SELECT nanvl(asin(10), 1.0), nanvl(1.0, 2.0), nanvl(asin(10), asin(10))
Review Comment:
👍 for testing when both args are NAN
##########
datafusion/core/tests/sqllogictests/test_files/math.slt:
##########
@@ -93,3 +93,9 @@ query RRRRRRR
SELECT atan2(2.0, 1.0), atan2(-2.0, 1.0), atan2(2.0, -1.0), atan2(-2.0, -1.0), atan2(NULL, 1.0), atan2(2.0, NULL), atan2(NULL, NULL);
----
1.107148717794 -1.107148717794 2.034443935796 -2.034443935796 NULL NULL NULL
+
+# nanvl
+query RRR
+SELECT nanvl(asin(10), 1.0), nanvl(1.0, 2.0), nanvl(asin(10), asin(10))
Review Comment:
👍 for testing when both args are NAN
--
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
[GitHub] [arrow-datafusion] sarutak commented on pull request #7171: Add nanvl builtin function
Posted by "sarutak (via GitHub)" <gi...@apache.org>.
sarutak commented on PR #7171:
URL: https://github.com/apache/arrow-datafusion/pull/7171#issuecomment-1661112253
@alamb
Thank you for the feedback!
I've added an entry to the guide.
https://github.com/sarutak/arrow-datafusion/blob/nanvl/docs/source/user-guide/sql/scalar_functions.md#nanvl
--
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