Kontinuation commented on code in PR #514:
URL: https://github.com/apache/sedona-db/pull/514#discussion_r2693129714
##########
rust/sedona-spatial-join/src/utils/join_utils.rs:
##########
@@ -355,25 +359,45 @@ pub(crate) fn get_semi_indices<T: ArrowPrimitiveType>(
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);
- });
-
+ let bitmap = build_range_bitmap(&range, input_indices);
let offset = range.start;
-
// get the semi index
(range)
.filter_map(|idx| (bitmap.get_bit(idx -
offset)).then_some(T::Native::from_usize(idx)))
.collect()
}
+pub(crate) fn get_mark_indices<T: ArrowPrimitiveType, R: ArrowPrimitiveType>(
+ range: &Range<usize>,
+ input_indices: &PrimitiveArray<T>,
+) -> PrimitiveArray<R>
+where
+ NativeAdapter<T>: From<<T as ArrowPrimitiveType>::Native>,
+{
Review Comment:
I have commented this function. I'd like to keep the generic interface
as-is, in order to be consistent with the original DataFusion code.
--
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]