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? # 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
In the range function, if step is a negative number, since the parameter is specified as usize, step=-1 is converted to 18446744073709551614, which leads to incorrect results. https://github.com/apache/arrow-datafusion/blob/9619f02db79c794212437415b1e6a53b44eef4c9/datafusion/physical-expr/src/array_expressions.rs#L749C50-L749C51 Therefore, we need to specially handle the case where step is a negative number.
run :
select range(1, 10, -2) result is [1]
select range(1, 10, -2)
[1]
As a comparison: duckdb {width=40px height=30px}
clickhouse
result is []
[]
No response
The text was updated successfully, but these errors were encountered:
cc @alamb @Veeupup
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
In the range function, if step is a negative number, since the parameter is specified as usize, step=-1 is converted to 18446744073709551614, which leads to incorrect results.
https://github.com/apache/arrow-datafusion/blob/9619f02db79c794212437415b1e6a53b44eef4c9/datafusion/physical-expr/src/array_expressions.rs#L749C50-L749C51
Therefore, we need to specially handle the case where step is a negative number.
To Reproduce
run :
select range(1, 10, -2)
result is[1]
As a comparison:
{width=40px height=30px}
duckdb
clickhouse

Expected behavior
result is
[]
Additional context
No response
The text was updated successfully, but these errors were encountered: