Rich-T-kid commented on code in PR #11174:
URL: https://github.com/apache/arrow-rs/pull/11174#discussion_r4321627569
##########
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:
I think we should consildate this into one error, being
```rust
index out of bounds: the len is 64 but the index is 99
```
avoiding panics is always good
--
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]