Skip to content

Commit

Permalink
Update array_and_element behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jkosh44 committed Feb 13, 2025
1 parent 9e3754e commit 81e3b52
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 40 deletions.
2 changes: 1 addition & 1 deletion datafusion/expr-common/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ impl Signature {
ArrayFunctionArgument::Array,
ArrayFunctionArgument::Element,
],
array_coercion: None,
array_coercion: Some(ListCoercion::FixedSizedListToList),
},
),
volatility,
Expand Down
13 changes: 1 addition & 12 deletions datafusion/functions-nested/src/concat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,7 @@ impl Default for ArrayAppend {
impl ArrayAppend {
pub fn new() -> Self {
Self {
signature: Signature {
type_signature: TypeSignature::ArraySignature(
ArrayFunctionSignature::Array {
arguments: vec![
ArrayFunctionArgument::Array,
ArrayFunctionArgument::Element,
],
array_coercion: Some(ListCoercion::FixedSizedListToList),
},
),
volatility: Volatility::Immutable,
},
signature: Signature::array_and_element(Volatility::Immutable),
aliases: vec![
String::from("list_append"),
String::from("array_push_back"),
Expand Down
30 changes: 3 additions & 27 deletions datafusion/functions-nested/src/remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ use arrow::array::{
use arrow::buffer::OffsetBuffer;
use arrow::datatypes::{DataType, Field};
use datafusion_common::cast::as_int64_array;
use datafusion_common::utils::ListCoercion;
use datafusion_common::{exec_err, utils::take_function_args, Result};
use datafusion_expr::{
ArrayFunctionArgument, ArrayFunctionSignature, ColumnarValue, Documentation,
ScalarUDFImpl, Signature, TypeSignature, Volatility,
ColumnarValue, Documentation, ScalarUDFImpl, Signature, Volatility,
};
use datafusion_macros::user_doc;
use std::any::Any;
Expand Down Expand Up @@ -80,18 +78,7 @@ impl Default for ArrayRemove {
impl ArrayRemove {
pub fn new() -> Self {
Self {
signature: Signature {
type_signature: TypeSignature::ArraySignature(
ArrayFunctionSignature::Array {
arguments: vec![
ArrayFunctionArgument::Array,
ArrayFunctionArgument::Element,
],
array_coercion: Some(ListCoercion::FixedSizedListToList),
},
),
volatility: Volatility::Immutable,
},
signature: Signature::array_and_element(Volatility::Immutable),
aliases: vec!["list_remove".to_string()],
}
}
Expand Down Expand Up @@ -248,18 +235,7 @@ pub(super) struct ArrayRemoveAll {
impl ArrayRemoveAll {
pub fn new() -> Self {
Self {
signature: Signature {
type_signature: TypeSignature::ArraySignature(
ArrayFunctionSignature::Array {
arguments: vec![
ArrayFunctionArgument::Array,
ArrayFunctionArgument::Element,
],
array_coercion: Some(ListCoercion::FixedSizedListToList),
},
),
volatility: Volatility::Immutable,
},
signature: Signature::array_and_element(Volatility::Immutable),
aliases: vec!["list_remove_all".to_string()],
}
}
Expand Down

0 comments on commit 81e3b52

Please sign in to comment.