Skip to content

panic: array_repeat list path overflows inner element count multiplication #22219

@Dandandan

Description

@Dandandan

Describe the bug

array_repeat can panic for list inputs when len * count overflows while calculating the repeated inner value count.

To Reproduce

SELECT array_repeat([1,2,3], 9223372036854775807);

Actual behavior

thread 'main' panicked at datafusion/functions-nested/src/repeat.rs:245:32:
attempt to multiply with overflow

Expected behavior

Return an execution error for an output-size overflow instead of panicking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions