patrickswedish opened a new pull request, #11657:
URL: https://github.com/apache/arrow-rs/pull/11657

   # Which issue does this PR close?
   
   Closes #11612.
   
   # Rationale for this change
   
   `Fields::filter_leaves` and `Fields::try_filter_leaves` perform a 
depth-first traversal over nested `DataType` variants so that the filter 
predicate is invoked only on leaf fields (fields with no children). Currently, 
`try_filter_leaves` handles `DataType::List`, `DataType::LargeList`, and 
`DataType::FixedSizeList`, but omits `DataType::ListView` and 
`DataType::LargeListView`, causing `ListView` and `LargeListView` fields to be 
treated as leaf fields instead of descending into their element `FieldRef`.
   
   # What changes are included in this PR?
   
   - Add `DataType::ListView(child)` and `DataType::LargeListView(child)` match 
arms in `Fields::try_filter_leaves` (`arrow-schema/src/fields.rs`) to 
recursively filter their child element field, matching the behavior of `List` 
and `LargeList`.
   - Add `test_filter_list_view` covering leaf filtering and leaf index 
counting across nested and primitive `ListView` and `LargeListView` fields.
   
   # Are there any user-facing changes?
   
   Yes, `Fields::filter_leaves` and `Fields::try_filter_leaves` now properly 
descend into `DataType::ListView` and `DataType::LargeListView` child fields.
   


-- 
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]

Reply via email to