Skip to content

Sort operator disappear in physical_plan #5100

@xiaoyong-z

Description

@xiaoyong-z

Describe the bug
A clear and concise description of what the bug is.
After we disable the repartition ProjectionExec when it does not compute anything, sort operator in subquery went wrong

To Reproduce
Steps to reproduce the behavior:
CREATE EXTERNAL TABLE aggregate_test_100 (
c1 VARCHAR NOT NULL,
c2 TINYINT NOT NULL,
c3 SMALLINT NOT NULL,
c4 SMALLINT,
c5 INT,
c6 BIGINT NOT NULL,
c7 SMALLINT NOT NULL,
c8 INT NOT NULL,
c9 BIGINT UNSIGNED NOT NULL,
c10 VARCHAR NOT NULL,
c11 FLOAT NOT NULL,
c12 DOUBLE NOT NULL,
c13 VARCHAR NOT NULL
)
STORED AS CSV
WITH HEADER ROW
LOCATION 'xxxx/csv/aggregate_test_100.csv';

SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 1;
0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm

SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 1);
6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW

explain SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 1);
image

Expected behavior
A clear and concise description of what you expected to happen.
There is a sort operator in logical_plan, but there is no sort exec in c.

Additional context
Add any other context about the problem here.
Found in #5074

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