Rich-T-kid commented on code in PR #11174:
URL: https://github.com/apache/arrow-rs/pull/11174#discussion_r4321810041


##########
arrow-select/src/coalesce.rs:
##########
@@ -335,11 +396,71 @@ impl BatchCoalescer {
         batch: RecordBatch,
         indices: &dyn Array,
     ) -> Result<(), ArrowError> {
-        // todo: optimize this to avoid materializing (copying the results of 
take indices to a new batch)
+        let exceeds_byte_view_threshold = self.has_byte_view_columns
+            && !should_use_byte_view_indexed_copy(batch.num_rows(), 
indices.len());
+        if exceeds_byte_view_threshold
+            && let Some(u32_arr) = 
indices.as_any().downcast_ref::<UInt32Array>()
+            && u32_arr.null_count() == 0
+        {
+            validate_indices_bounds(u32_arr.values(), batch.num_rows())?;

Review Comment:
   addressed with 
`test_push_batch_with_indices_oob_error_is_uniform_across_schemas`



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