Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MINOR]: Remove unecessary orderings from the final plan #8289

Merged
merged 2 commits into from
Nov 21, 2023
Merged

[MINOR]: Remove unecessary orderings from the final plan #8289

merged 2 commits into from
Nov 21, 2023

Conversation

mustafasrepo
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

In some of the plans, there are unnecessary SortExec, where ordered fields are not used (exist at the final plan.) This PR remove SortExecs for these cases from the plan.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Nov 21, 2023
@ozankabak ozankabak marked this pull request as draft November 21, 2023 09:49
@ozankabak
Copy link
Contributor

(this doesn't exactly do the right thing -- we will update this today and re-open)

@ozankabak ozankabak marked this pull request as ready for review November 21, 2023 11:58
Copy link
Contributor

@ozankabak ozankabak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @alamb, would appreciate a quick look from you

//
// More rationale:
// https://github.com/apache/arrow-datafusion/pull/6354#discussion_r1195284178
match &self.sort_order {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We experienced some problems with this as well (added sorts), so happy to see this go :)

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mustafasrepo and @Dandandan

------Projection: aggregate_test_100.c2, aggregate_test_100.c1
--------TableScan: aggregate_test_100 projection=[c1, c2]
physical_plan
AggregateExec: mode=FinalPartitioned, gby=[c2@0 as c2], aggr=[COUNT(*)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 it is nice to see no Sort!

@alamb alamb changed the title [MINOR]: Remove lost orderings from the final plan [MINOR]: Remove unecessary orderings from the final plan Nov 21, 2023
@alamb alamb merged commit ffbc689 into apache:main Nov 21, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants