We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From this changes, I find some inconsistent behavior for `divide` about `zero`.
❯ \d left +---------------+--------------+------------+-------------+-----------+-------------+ | table_catalog | table_schema | table_name | column_name | data_type | is_nullable | +---------------+--------------+------------+-------------+-----------+-------------+ | datafusion | public | left | c | Int32 | YES | +---------------+--------------+------------+-------------+-----------+-------------+ 1 row in set. Query took 0.054 seconds. ❯ select c/0 from left; ArrowError(DivideByZero) ❯ select 10/0; +----------------------+ | Int64(10) / Int64(0) | +----------------------+ | | +----------------------+
The difference is from the arrow-rs kernel divide_scalar and divide_opt.
divide_scalar
divide_opt
In the divide_scalar, it will check the zero for the right, but in the divide_opt, the result will be replaced with NULL if the right value is zero.
zero
NULL
cc @alamb
Originally posted by @liukun4515 in #4648 (comment)
The text was updated successfully, but these errors were encountered:
Seems related to #3849 as well
Sorry, something went wrong.
Thanks @Jefffrey we need to reconsider divide/0
divide/0
0 / 0
Successfully merging a pull request may close this issue.
The difference is from the arrow-rs kernel
divide_scalar
anddivide_opt
.In the
divide_scalar
, it will check thezero
for the right, but in thedivide_opt
, the result will be replaced withNULL
if the right value is zero.cc @alamb
Originally posted by @liukun4515 in #4648 (comment)
The text was updated successfully, but these errors were encountered: