Describe the bug
While working on #18363 I saw an inconsistency within match arm logic for different inner List types for LargeList.
-let (inner_field, inner_offsets, inner_values, nulls) = // in LargeList(LargeList)
+let (inner_field, inner_offsets, inner_values, _) = // in LargeList(List)
as_list_array(&values)?.clone().into_parts();
let flattened_array = GenericListArray::<i64>::new(
inner_field,
offsets,
inner_values,
nulls, <------- the validity buffer is used here
);
To Reproduce
To reproduce the error, I fixed an existing sqllogictest to have LargeList(nullable LargeList(nullable Int64))
This way when we generate a flattened_array the validity buffer's len and values difference will cause an error.
External error: task 26 panicked with message "called `Result::unwrap()` on an `Err` value: InvalidArgumentError(\"Incorrect length of null buffer for LargeListArray, expected 1 got 5\")"
Expected behavior
The expected behavior is to pass the new sqllogictest
flatten(arrow_cast(make_array([1], null, [2, 3], [null], make_array(4, null, 5)), 'LargeList(LargeList(Int64))')),
----
[1, NULL, 2, 3, NULL, 4, NULL, 5]
Additional context
No response
Describe the bug
While working on #18363 I saw an inconsistency within match arm logic for different inner List types for
LargeList.To Reproduce
To reproduce the error, I fixed an existing
sqllogictestto haveLargeList(nullable LargeList(nullable Int64))This way when we generate a
flattened_arraythe validity buffer's len and values difference will cause an error.Expected behavior
The expected behavior is to pass the new
sqllogictestAdditional context
No response