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

fix: planning of prepare statement with limit clause #13088

Merged
merged 2 commits into from
Oct 26, 2024

Conversation

jonahgao
Copy link
Member

Which issue does this PR close?

Closes #12294.

Rationale for this change

This PR enables creating logical plan for a prepare statement with a limit clause.
Creating physical plan for prepare is not yet supported and is being tracked in #4539.

What changes are included in this PR?

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions bot added the sql SQL Planner label Oct 24, 2024
@@ -88,10 +90,10 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
let empty_schema = DFSchema::empty();

let skip = skip
.map(|o| self.sql_to_expr(o.value, &empty_schema, &mut PlannerContext::new()))
.map(|o| self.sql_to_expr(o.value, &empty_schema, planner_context))
Copy link
Member Author

Choose a reason for hiding this comment

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

We should use the existing PlannerContext that includes prepare_param_data_types, instead of creating an empty one.

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 @jonahgao -- this is a great find and a very nice fix

FYI @WeCodingNow

@alamb
Copy link
Contributor

alamb commented Oct 26, 2024

🚀

@alamb alamb merged commit d2511b2 into apache:main Oct 26, 2024
24 checks passed
@jonahgao jonahgao deleted the prepare_limit branch November 1, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support prepared statement arguments in the LIMIT clause
2 participants