gruuya commented on code in PR #9312:
URL: https://github.com/apache/arrow-datafusion/pull/9312#discussion_r1501357779
##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -372,13 +374,20 @@ fn coerced_from<'a>(
List(_) if matches!(type_from, FixedSizeList(_, _)) =>
Some(type_into.clone()),
// Only accept list and largelist with the same number of dimensions
unless the type is Null.
- // List or LargeList with different dimensions should be handled in
TypeSignature or other places before this.
+ // List or LargeList with different dimensions should be handled in
TypeSignature or other places before this
List(_) | LargeList(_)
if datafusion_common::utils::base_type(type_from).eq(&Null)
|| list_ndims(type_from) == list_ndims(type_into) =>
{
Some(type_into.clone())
}
+ // should be able to coerce wildcard fixed size list to non wildcard
fixed size list
+ FixedSizeList(_, _)
+ if matches!(type_from, FixedSizeList(_, FIXED_SIZE_LIST_WILDCARD))
+ && list_ndims(type_from) == list_ndims(type_into) =>
Review Comment:
Maybe there should even be a check for all nested types, which will cover
the base case as well (and the ndims check I think?)
```rust
FixedSizeList(f_into, _)
if matches!(type_from, FixedSizeList(f_from, FIXED_SIZE_LIST_WILDCARD))
&& coerced_from(f_into, f_from) == Some(f_into) =>
```
--
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]