Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions datafusion/functions-nested/src/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,6 @@ impl ArraySlice {
Self {
signature: Signature::one_of(
vec![
TypeSignature::ArraySignature(
ArrayFunctionSignature::ArrayAndIndexes(
NonZeroUsize::new(1).expect("1 is non-zero"),
),
),
TypeSignature::ArraySignature(
ArrayFunctionSignature::ArrayAndIndexes(
NonZeroUsize::new(2).expect("2 is non-zero"),
Expand Down
8 changes: 2 additions & 6 deletions datafusion/sqllogictest/test_files/array.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1850,15 +1850,11 @@ select array_slice(arrow_cast(make_array(1, 2, 3, 4, 5), 'LargeList(Int64)'), 0,
[] []

# array_slice scalar function #11 (with NULL-NULL)
query ??
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is consistent with duckdb too 👍

D select array_slice([1,2,3], null);
Binder Error: No function matches the given name and argument types 'array_slice(INTEGER[], "NULL")'. You might need to add explicit type casts.
	Candidate functions:
	array_slice(ANY, ANY, ANY) -> ANY
	array_slice(ANY, ANY, ANY, BIGINT) -> ANY

LINE 1: select array_slice([1,2,3], null);

query error
select array_slice(make_array(1, 2, 3, 4, 5), NULL), array_slice(make_array('h', 'e', 'l', 'l', 'o'), NULL);
----
NULL NULL

query ??
query error
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);
----
NULL NULL

# array_slice scalar function #12 (with zero and negative number)
query ??
Expand Down