findepi commented on code in PR #13756:
URL: https://github.com/apache/datafusion/pull/13756#discussion_r1884516372
##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -414,7 +415,18 @@ fn get_valid_types(
_ => Ok(vec![vec![]]),
}
}
+
fn array(array_type: &DataType) -> Option<DataType> {
+ match array_type {
+ DataType::List(_) => Some(array_type.clone()),
+ DataType::LargeList(field) | DataType::FixedSizeList(field, _) => {
+ Some(DataType::List(Arc::clone(field)))
+ }
+ _ => None,
+ }
+ }
+
+ fn recursive_array(array_type: &DataType) -> Option<DataType> {
Review Comment:
the pre-existing `array` signature implied recursively array-infication
(replacing FixedLengthList with List, recursively), didn't imply flattening.
the recursive type normalization matters for flatten only, cause it
(currently) operates recursively and otherwise would need to gain code to
handle FixedLengthList inputs
the recursive array-ification was useless for other array functions and was
made non-recursive.
to compensate for this change, new RecursiveArray signature was added for
flatten case.
--
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]