comphead commented on code in PR #16083: URL: https://github.com/apache/datafusion/pull/16083#discussion_r2141908140
########## datafusion/physical-plan/src/joins/utils.rs: ########## @@ -1102,6 +1129,30 @@ where .collect() } +pub(crate) fn get_mark_indices<T: ArrowPrimitiveType>( + range: &Range<usize>, + input_indices: &PrimitiveArray<T>, +) -> PrimitiveArray<UInt32Type> +where + NativeAdapter<T>: From<<T as ArrowPrimitiveType>::Native>, +{ + let mut bitmap = BooleanBufferBuilder::new(range.len()); + bitmap.append_n(range.len(), false); + input_indices + .iter() + .flatten() + .map(|v| v.as_usize()) + .filter(|v| range.contains(v)) + .for_each(|v| { + bitmap.set_bit(v - range.start, true); + }); Review Comment: `map.filter.foreach` wondering can it be done in single iteration? -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org