Jefffrey commented on code in PR #17672:
URL: https://github.com/apache/datafusion/pull/17672#discussion_r2363199906
##########
datafusion/functions-nested/src/flatten.rs:
##########
@@ -104,7 +94,7 @@ impl ScalarUDFImpl for Flatten {
fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
let data_type = match &arg_types[0] {
- List(field) | FixedSizeList(field, _) => match field.data_type() {
+ List(field) => match field.data_type() {
Review Comment:
Removed `FixedSizeList` since signature should coerce it to `List`
##########
datafusion/functions-nested/src/resize.rs:
##########
@@ -125,7 +125,7 @@ impl ScalarUDFImpl for ArrayResize {
fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
match &arg_types[0] {
- List(field) | FixedSizeList(field, _) =>
Ok(List(Arc::clone(field))),
+ List(field) => Ok(List(Arc::clone(field))),
Review Comment:
Same reason as flatten
##########
datafusion/sqllogictest/test_files/array.slt:
##########
@@ -2788,7 +2798,6 @@ select array_append(column1, arrow_cast(make_array(1, 11,
111), 'FixedSizeList(3
# DuckDB: [4]
# ClickHouse: Null
-# Since they dont have the same result, we just follow Postgres, return error
Review Comment:
Removed this since the query doesn't seem to error (am I misunderstanding
what the comment means 🤔 )
##########
datafusion/functions-nested/src/length.rs:
##########
@@ -79,7 +80,22 @@ impl Default for ArrayLength {
impl ArrayLength {
pub fn new() -> Self {
Self {
- signature: Signature::variadic_any(Volatility::Immutable),
+ signature: Signature::one_of(
+ vec![
+
TypeSignature::ArraySignature(ArrayFunctionSignature::Array {
+ arguments: vec![ArrayFunctionArgument::Array],
+ array_coercion: None,
Review Comment:
No coercion here as the implementation natively supports `FixedSizeList`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]