Skip to content

rpad function causes OOM #5415

@ZuoTiJia

Description

@ZuoTiJia

Describe the bug
When I use the rpad function, and the parameter of the rpad function is large, it causes OOM.
Does Datafusion have a mechanism to limit the resources required for execution.

To Reproduce

create table test(a bigint) as values
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1),
    (1), (1), (1), (1), (1);
select rpad('a', 1073741824, 'a') from test;

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

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