Skip to content

Commit 1626c00

Browse files
bug: fix offset type mismatch when prepending lists (apache#14672)
1 parent 9445679 commit 1626c00

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

datafusion/functions-nested/src/concat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ where
468468
};
469469

470470
let res = match list_array.value_type() {
471-
DataType::List(_) => concat_internal::<i32>(args)?,
472-
DataType::LargeList(_) => concat_internal::<i64>(args)?,
471+
DataType::List(_) => concat_internal::<O>(args)?,
472+
DataType::LargeList(_) => concat_internal::<O>(args)?,
473473
data_type => {
474474
return generic_append_and_prepend::<O>(
475475
list_array,

datafusion/sqllogictest/test_files/array.slt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,13 +2664,12 @@ select array_prepend(arrow_cast(make_array(1), 'FixedSizeList(1, Int64)'), make_
26642664
----
26652665
[[1], [2], [3], [4]] [[1.0], [2.0], [3.0], [4.0]] [[h], [e], [l], [l], [o]]
26662666

2667-
# TODO: https://github.com/apache/datafusion/issues/14613
2668-
#query ???
2669-
#select array_prepend(arrow_cast(make_array(1), 'FixedSizeList(1, Int64)'), arrow_cast(make_array(make_array(2), make_array(3), make_array(4)), 'LargeList(FixedSizeList(1, Int64))')),
2670-
# array_prepend(arrow_cast(make_array(1.0), 'FixedSizeList(1, Float64)'), arrow_cast(make_array([2.0], [3.0], [4.0]), 'LargeList(FixedSizeList(1, Float64))')),
2671-
# array_prepend(arrow_cast(make_array('h'), 'FixedSizeList(1, Utf8)'), arrow_cast(make_array(['e'], ['l'], ['l'], ['o']), 'LargeList(FixedSizeList(1, Utf8))'));
2672-
#----
2673-
#[[1], [2], [3], [4]] [[1.0], [2.0], [3.0], [4.0]] [[h], [e], [l], [l], [o]]
2667+
query ???
2668+
select array_prepend(arrow_cast(make_array(1), 'FixedSizeList(1, Int64)'), arrow_cast(make_array(make_array(2), make_array(3), make_array(4)), 'LargeList(FixedSizeList(1, Int64))')),
2669+
array_prepend(arrow_cast(make_array(1.0), 'FixedSizeList(1, Float64)'), arrow_cast(make_array([2.0], [3.0], [4.0]), 'LargeList(FixedSizeList(1, Float64))')),
2670+
array_prepend(arrow_cast(make_array('h'), 'FixedSizeList(1, Utf8)'), arrow_cast(make_array(['e'], ['l'], ['l'], ['o']), 'LargeList(FixedSizeList(1, Utf8))'));
2671+
----
2672+
[[1], [2], [3], [4]] [[1.0], [2.0], [3.0], [4.0]] [[h], [e], [l], [l], [o]]
26742673

26752674
query ???
26762675
select array_prepend(arrow_cast([1], 'FixedSizeList(1, Int64)'), arrow_cast([[1], [2], [3]], 'FixedSizeList(3, FixedSizeList(1, Int64))')),

0 commit comments

Comments
 (0)