-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
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:
But in the match pattern here:
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:
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.