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
8 changes: 6 additions & 2 deletions datafusion/functions-nested/src/except.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use arrow::array::{cast::AsArray, Array, ArrayRef, GenericListArray, OffsetSizeT
use arrow::buffer::OffsetBuffer;
use arrow::datatypes::{DataType, FieldRef};
use arrow::row::{RowConverter, SortField};
use datafusion_common::utils::take_function_args;
use datafusion_common::utils::{take_function_args, ListCoercion};
use datafusion_common::{internal_err, HashSet, Result};
use datafusion_expr::{
ColumnarValue, Documentation, ScalarUDFImpl, Signature, Volatility,
Expand Down Expand Up @@ -81,7 +81,11 @@ impl Default for ArrayExcept {
impl ArrayExcept {
pub fn new() -> Self {
Self {
signature: Signature::any(2, Volatility::Immutable),
signature: Signature::arrays(
2,
Some(ListCoercion::FixedSizedListToList),
Volatility::Immutable,
),
aliases: vec!["list_except".to_string()],
}
}
Expand Down
10 changes: 10 additions & 0 deletions datafusion/sqllogictest/test_files/array.slt
Original file line number Diff line number Diff line change
Expand Up @@ -7285,6 +7285,16 @@ select array_except(null, null)
----
NULL

query ?
select array_except(arrow_cast([1, 2, 3, 4], 'LargeList(Int64)'), arrow_cast([5, 6, 3, 4], 'LargeList(Int64)'));
----
[1, 2]

query ?
select array_except(arrow_cast([1, 2, 3, 4], 'FixedSizeList(4, Int64)'), arrow_cast([5, 6, 3, 4], 'FixedSizeList(4, Int64)'));
----
[1, 2]

### Array operators tests


Expand Down