Reserve space for `count` more elements, returning an error when the allocation would overflow `Vec`'s capacity limit or the allocator rejects it, rather than panicking on user-supplied SQL.
(values: &mut Vec<i64>, count: u64)
| 542 | /// allocation would overflow `Vec`'s capacity limit or the allocator |
| 543 | /// rejects it, rather than panicking on user-supplied SQL. |
| 544 | fn reserve_range_capacity(values: &mut Vec<i64>, count: u64) -> Result<()> { |
| 545 | let count_usize = usize::try_from(count).map_err(|_| { |
| 546 | exec_datafusion_err!( |
| 547 | "Range too large to materialize: would produce {count} elements" |
| 548 | ) |
| 549 | })?; |
| 550 | values.try_reserve(count_usize).map_err(|e| { |
| 551 | exec_datafusion_err!( |
| 552 | "Range too large to materialize: failed to allocate {count} elements: {e}" |
| 553 | ) |
| 554 | }) |
| 555 | } |
| 556 | |
| 557 | /// Generate integer range values directly into the provided buffer. |
| 558 | #[inline] |
no outgoing calls
no test coverage detected
searching dependent graphs…