Dandandan opened a new issue, #22228: URL: https://github.com/apache/datafusion/issues/22228
### Describe the bug `array_repeat(<scalar_const>, <large_const>)` — the simplest all-constant form — panics with `capacity overflow` from `raw_vec::reserve`, distinct from the previously-filed `array_repeat` overflows: - #22218 reproduces with a *column* `c` of `i64::MAX` and panics in `accum.rs` (`attempt to add with overflow`) while summing per-row counts. - #22219 reproduces with a *list* element and panics in `repeat.rs` (`attempt to multiply with overflow`) on `len * count`. This issue is the constant-scalar / single-row path: nothing is summed across rows and nothing is a list, but the final `Vec`-reserve for the repeated values still requests more than `isize::MAX` bytes and panics in `raw_vec`. ### To Reproduce ```bash cargo run -p datafusion-cli -- -c "SELECT array_repeat(1, 9223372036854775807)" ``` ### Actual behavior ``` DataFusion CLI v53.1.0 thread 'main' panicked at .../library/alloc/src/raw_vec/mod.rs:28:5: capacity overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` ### Expected behavior Return an execution error like `"array_repeat: requested length exceeds maximum array size"` rather than panicking. ### Environment - DataFusion CLI v53.1.0 (from `main` at commit 8741a7752c) ### Additional context Same family of missing-bounds-check panics as #22188, #22217, #22218, #22219 — but a third panic site (`raw_vec` capacity rather than `accum::Sum` or `repeat::mul`). A fix at the public `array_repeat` entry point that bounds `count` against `isize::MAX / size_of::<element>()` should close all three array_repeat variants at once; filing separately so each panic site is tracked. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
