Skip to content

Commit bab0f54

Browse files
authored
bug: Remove array_slice two arg variant (#14527)
In 3dfce7d I misunderstood an existing test and accidentally added a variant of `array_slice` that accepts two arguments. This variant is not valid and only works if one of the arguments are null. This commit fixes the problem by removing the two argument variant.
1 parent b9fba66 commit bab0f54

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

datafusion/functions-nested/src/extract.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,6 @@ impl ArraySlice {
329329
Self {
330330
signature: Signature::one_of(
331331
vec![
332-
TypeSignature::ArraySignature(
333-
ArrayFunctionSignature::ArrayAndIndexes(
334-
NonZeroUsize::new(1).expect("1 is non-zero"),
335-
),
336-
),
337332
TypeSignature::ArraySignature(
338333
ArrayFunctionSignature::ArrayAndIndexes(
339334
NonZeroUsize::new(2).expect("2 is non-zero"),

datafusion/sqllogictest/test_files/array.slt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,15 +1850,11 @@ select array_slice(arrow_cast(make_array(1, 2, 3, 4, 5), 'LargeList(Int64)'), 0,
18501850
[] []
18511851

18521852
# array_slice scalar function #11 (with NULL-NULL)
1853-
query ??
1853+
query error
18541854
select array_slice(make_array(1, 2, 3, 4, 5), NULL), array_slice(make_array('h', 'e', 'l', 'l', 'o'), NULL);
1855-
----
1856-
NULL NULL
18571855

1858-
query ??
1856+
query error
18591857
select array_slice(arrow_cast(make_array(1, 2, 3, 4, 5), 'LargeList(Int64)'), NULL), array_slice(arrow_cast(make_array('h', 'e', 'l', 'l', 'o'), 'LargeList(Utf8)'), NULL);
1860-
----
1861-
NULL NULL
18621858

18631859
# array_slice scalar function #12 (with zero and negative number)
18641860
query ??

0 commit comments

Comments
 (0)