timsaucer commented on code in PR #24345:
URL: https://github.com/apache/datafusion/pull/24345#discussion_r3783153007
##########
datafusion/functions-nested/src/extract.rs:
##########
@@ -622,6 +621,15 @@ where
let values = array.values();
let original_data = values.to_data();
let capacity = Capacities::Array(original_data.len());
+ // Carry the input's list field through to the output so that the returned
+ // type matches the one promised by `return_type` /
`return_field_from_args`,
+ // including the field name, nullability and metadata.
+ let field = match array.data_type() {
+ List(field) | LargeList(field) => Arc::clone(field),
+ other => {
+ return internal_err!("array_slice got unexpected data type:
{other}");
+ }
+ };
let mut mutable =
MutableArrayData::with_capacities(vec![&original_data], true,
capacity);
Review Comment:
Agreed, applied in `general_array_slice` and `general_list_view_array_slice`
--
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]