Incorrect and inconsistency handling of NULL values in ScalarValue
for ListArray
#7968
Labels
bug
Something isn't working
ScalarValue
for ListArray
#7968
Describe the bug
try_from_array
produces inconsistentScalarValue::List
for valid and non-valid (NULL) valuesFor NULL value in ListArray,
try_from_array
producesScalarValue::List(new_null_array(&DataType::Null, 0))
which isn't consistent with the case when invokingtry_from_array
on valid value ofListArray
.Fro valid value,
try_from_array
produces aListArray
containing single element of the specified value in providedListArray
. For example, if input array isListArray[[1, 2, 3], [4, 5, 6]]]
,try_from_array(arr, 0)
will produceListArray[[1, 2, 3]]
.For NULL value,
try_from_array
currently produces a null array ofDataType::Null
type. Not only it is not aListArray
, the data type is not the element type of providedListArray
too.ScalarValue::List
has same value and datatype forListArray
and nestedListArray
's NULL valuesNULL values from
ListArray
and nestedListArray
are the sameScalarValue::List(new_null_array(&DataType::Null, 0))
. So their datatypes are the same. This is also incorrect.To Reproduce
No response
Expected behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: