You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
debug_assert_eq! in BatchCoalescer panics in debug mode when batch_size < 4 #9506
Describe the bug debug_assert_eq!(self.current.capacity(), self.batch_size) in InProgressPrimitiveArray::ensure_capacity (and same in InProgressByteViewArray) panics in debug mode. Vec::reserve(n) does not guarantee exact capacity, Rust's MIN_NON_ZERO_CAP optimization means for most numeric types, reserve(2) gives capacity = 4, not 2.
To Reproduce
use arrow::compute::BatchCoalescer;use arrow::datatypes::{DataType,Field,Schema};use arrow::array::{Int32Array,RecordBatch};use std::sync::Arc;let schema = Arc::new(Schema::new(vec![Field::new("a",DataType::Int32,false)]));letmut coalescer = BatchCoalescer::new(schema.clone(),2);let batch = RecordBatch::try_new(
schema,vec![Arc::new(Int32Array::from(vec![1,2,3]))],).unwrap();
coalescer.push_batch(batch).unwrap();// panics in debug mode
Expected behavior
No panic. The assertion should account for the fact that Vec::reserve guarantees at least the requested capacity, not exactly.
Activity
alamb commentedon Mar 5, 2026
Nice sleuthing 🕵️
fix: remove incorrect debug assertion in BatchCoalescer (#9508)
fix: Run release verification with `--profile=ci` (#20987)
alamb commentedon Mar 18, 2026
label_issue.pyautomatically added labels {'arrow'} from #9508fix: Run release verification with `--profile=ci` (apache#20987)