manishkr commented on code in PR #9036:
URL: https://github.com/apache/arrow-rs/pull/9036#discussion_r2648942361


##########
arrow-select/src/filter.rs:
##########
@@ -495,14 +495,21 @@ where
     let filter_values = predicate.filter.values();
     let run_ends = run_ends.inner();
 
+    let offset = array.offset() as u64;
+    let slice_end = (offset + array.len() as u64).min(offset + 
filter_values.len() as u64);
+
     let pred: BooleanArray = BooleanBuffer::collect_bool(run_ends.len(), |i| {
         let mut keep = false;
-        let mut end = run_ends[i].into() as u64;
-        let difference = end.saturating_sub(filter_values.len() as u64);
-        end -= difference;
+        let end = run_ends[i].into() as u64;
+
+        let loop_start = start.max(offset);
+        let loop_end = end.min(slice_end);

Review Comment:
   Thanks. Same comments as above.



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