stestagg opened a new issue, #4205:
URL: https://github.com/apache/arrow-datafusion/issues/4205
**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:
https://github.com/apache/arrow-rs/commit/3a90654f4cb98ac7fe278991a6cbc11384664e2e
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.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]