Dandandan opened a new issue, #22218:
URL: https://github.com/apache/datafusion/issues/22218

   ### Describe the bug
   
   `array_repeat` can panic on scalar elements when the total repeated-value 
count overflows `usize` while summing counts.
   
   ### To Reproduce
   
   ```sql
   SELECT array_repeat(1, c)
   FROM (
     VALUES
       (9223372036854775807),
       (9223372036854775807),
       (9223372036854775807)
   ) AS t(c);
   ```
   
   ### Actual behavior
   
   ```text
   thread 'main' panicked at .../library/core/src/iter/traits/accum.rs:204:1:
   attempt to add with overflow
   ```
   
   ### Expected behavior
   
   Return an execution error for an output-size overflow, not a panic.
   
   ### Notes
   
   The overflow comes from summing the per-row repeat counts before building 
the result.


-- 
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]

Reply via email to