You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Dandandan (via GitHub)" <gi...@apache.org> on 2026/05/15 20:32:50 UTC
[I] panic: array_repeat capacity overflow on constant scalar with large count [datafusion]
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: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] panic: array_repeat capacity overflow on constant scalar with large count [datafusion]
Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew closed issue #22228: panic: array_repeat capacity overflow on constant scalar with large count
URL: https://github.com/apache/datafusion/issues/22228
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] panic: array_repeat capacity overflow on constant scalar with large count [datafusion]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on issue #22228:
URL: https://github.com/apache/datafusion/issues/22228#issuecomment-4468436710
take
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org