Skip to content

panic: repeat string array path overflows capacity calculation #22217

Closed

Description

@Dandandan

Describe the bug

The array execution path for repeat(string, count) can panic on a large count because it multiplies string length by count before checking for overflow.

To Reproduce

SELECT repeat(x, 9223372036854775807)
FROM (VALUES ('abc')) AS t(x);

Actual behavior

thread 'main' panicked at datafusion/functions/src/string/repeat.rs:237:41:
attempt to multiply with overflow

Expected behavior

Return a string-size overflow error, as the scalar path already does, rather than panicking.

Notes

This reproducer uses a one-row input column so it reaches the array path without trying to allocate the full result.

Activity

  1. added a commit that references this issue on May 29, 2026
    32a1fe5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions