alamb commented on a change in pull request #8364: URL: https://github.com/apache/arrow/pull/8364#discussion_r503424868
########## File path: rust/arrow/src/compute/kernels/filter.rs ########## @@ -230,6 +231,86 @@ macro_rules! filter_dictionary_array { }}; } +macro_rules! filter_primitive_item_list_array { + ($context:expr, $array:expr, $item_type:ident) => {{ + let input_array = $array.as_any().downcast_ref::<ListArray>().unwrap(); + let values_builder = PrimitiveBuilder::<$item_type>::new($context.filtered_count); + let mut builder = ListBuilder::new(values_builder); + for i in 0..$context.filter_u64.len() { + // foreach u64 batch + let filter_batch = $context.filter_u64[i]; + if filter_batch == 0 { + // if batch == 0: skip Review comment: This makes total sense @yordan-pavlov -- I was suggesting an improvement to the comment itself. Perhaps something like: ```suggestion // if batch == 0, all items are filtered out, so skip entire batch ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org