Skip to content
New issue

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

Nullif func states support for Boolean type, but fails if this is attempted #4205

Closed
stestagg opened this issue Nov 14, 2022 · 0 comments · Fixed by #4737
Closed

Nullif func states support for Boolean type, but fails if this is attempted #4205

stestagg opened this issue Nov 14, 2022 · 0 comments · Fixed by #4737
Labels
bug Something isn't working

Comments

@stestagg
Copy link

Describe the bug
The nullif() reports that it supports Boolean arguments, but calling it with boolean arguments results in an internal error.

The message here suggests that Boolean is supported (When nullif is called with different unsupported types):

execute sql "select nullif('A', 'B')"
>> Error during planning: Coercion from [Utf8, Utf8] to the signature Uniform(2, [Boolean, UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64, Float32, Float64]) failed.

To Reproduce
evaluate: SELECT nullif(1=2, FALSE)

execute sql "select nullif(1 = 2, FALSE)"
>> External error: Internal error: Unsupported data type Boolean for NULLIF/primitive/boolean operator. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

Expected behavior
Either Boolean is not listed as supported argument type, or the nullif() function performs as expected.

Additional context

So, it seems like Boolean is included in this list:

https://github.com/apache/arrow-datafusion/blob/d72b4f04cf12424a54b22bf376b87065d5fcb6aa/datafusion/expr/src/nullif.rs#L23

But in the match pattern here:

https://github.com/apache/arrow-datafusion/blob/d72b4f04cf12424a54b22bf376b87065d5fcb6aa/datafusion/physical-expr/src/expressions/nullif.rs#L46

It's not.

The underlying Arrow function does not support non-primitive array types in 0.26, but has recently been updated and in 0.27 now appears to:

apache/arrow-rs@3a90654

So I guess it's a case of waiting for the arrow dependency version to be bumped, but then the additional type(s) should probably be added in the datafusion files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant