Skip to content

Fix Select Into with Order By and Limit#6442

Merged
mustafasrepo merged 2 commits intoapache:mainfrom
synnada-ai:feature/fix-select-into
May 25, 2023
Merged

Fix Select Into with Order By and Limit#6442
mustafasrepo merged 2 commits intoapache:mainfrom
synnada-ai:feature/fix-select-into

Conversation

@berkaysynnada
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #6440.

Rationale for this change

Select Into queries with order by or limit statements give an error while creating an initial physical plan.

What changes are included in this PR?

In SELECT INTO queries, CreateMemoryTable plan was built before order by and limit planning. However, in CREATE TABLE AS queries, CreateMemoryTable is built with the finalized logical plan (after order by and limit statements are included the plan). Select Into follows the same planning order now.

Are these changes tested?

Yes.

Are there any user-facing changes?

@github-actions github-actions Bot added core Core DataFusion crate sql SQL Planner sqllogictest SQL Logic Tests (.slt) labels May 25, 2023
Copy link
Copy Markdown
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.

Looks like a good change to me -- thank you @berkaysynnada

@mustafasrepo mustafasrepo merged commit 444f0c4 into apache:main May 25, 2023
@berkaysynnada berkaysynnada deleted the feature/fix-select-into branch June 20, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate sql SQL Planner sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SELECT INTO with ORDER BY or LIMIT

4 participants