Skip to content

Commit b67eecd

Browse files
committed
test: cover array_slice index buffer reuse across slicing modes
1 parent a511f02 commit b67eecd

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎datafusion/sqllogictest/test_files/array/array_slice.slt‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,26 @@ NULL
450450
NULL
451451
[1, 3, 5]
452452

453+
# array_slice switching between strided, contiguous, empty, NULL and
454+
# negative-stride rows in one batch
455+
query ??
456+
select array_slice(column1, column2, column3, column4),
457+
array_slice(arrow_cast(column1, 'ListView(Int64)'), column2, column3, column4)
458+
from (
459+
values
460+
(make_array(1, 2, 3, 4, 5, 6, 7, 8, 9), 1, 9, 2),
461+
(make_array(1, 2, 3, 4, 5), 2, 4, 1),
462+
(make_array(), 1, 3, 2),
463+
(NULL, 1, 3, 2),
464+
(make_array(1, 2, 3, 4, 5), 5, 1, -3)
465+
) as t(column1, column2, column3, column4);
466+
----
467+
[1, 3, 5, 7, 9] [1, 3, 5, 7, 9]
468+
[2, 3, 4] [2, 3, 4]
469+
[] []
470+
NULL NULL
471+
[5, 2] [5, 2]
472+
453473
# maintains inner nullability
454474
query ?T
455475
select array_slice(column1, 2, 3), arrow_typeof(array_slice(column1, 2, 3))

0 commit comments

Comments
 (0)