This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new bab0f54daa bug: Remove array_slice two arg variant (#14527)
bab0f54daa is described below
commit bab0f54daa99830339c0000a19c1b4e3489278ad
Author: Joseph Koshakow <[email protected]>
AuthorDate: Thu Feb 6 14:35:33 2025 -0500
bug: Remove array_slice two arg variant (#14527)
In 3dfce7d33c19d6e7941b58cb7e83194c066347ca 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.
---
datafusion/functions-nested/src/extract.rs | 5 -----
datafusion/sqllogictest/test_files/array.slt | 8 ++------
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/datafusion/functions-nested/src/extract.rs
b/datafusion/functions-nested/src/extract.rs
index 8c120876c3..b472316d03 100644
--- a/datafusion/functions-nested/src/extract.rs
+++ b/datafusion/functions-nested/src/extract.rs
@@ -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"),
diff --git a/datafusion/sqllogictest/test_files/array.slt
b/datafusion/sqllogictest/test_files/array.slt
index 01aca94a5d..8f23bfe5ea 100644
--- a/datafusion/sqllogictest/test_files/array.slt
+++ b/datafusion/sqllogictest/test_files/array.slt
@@ -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 ??
+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 ??
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]