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


##########
arrow-select/src/coalesce.rs:
##########
@@ -336,11 +404,81 @@ 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)
+        if 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:
   the only reason why this is kept to u32's it to avoid adding a macro that 
handles all types (`u8`...`u32`..`u64`). this can be added very easily but I 
think u32's are a fair bound



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