-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Upgrade to sqlparser 0.53.0
#13767
Upgrade to sqlparser 0.53.0
#13767
Conversation
6dc5055
to
3e521f1
Compare
@@ -200,7 +204,6 @@ impl<S: ContextProvider> SqlToRel<'_, S> { | |||
statement: Statement, | |||
planner_context: &mut PlannerContext, | |||
) -> Result<LogicalPlan> { | |||
let sql = Some(statement.to_string()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was needed because otherwise tpcds_logical_q64
overflowed its stack
https://github.com/apache/datafusion/actions/runs/12322166828/job/34395679472?pr=13767
thread 'tpcds_logical_q64' has overflowed its stack
fatal runtime error: stack overflow
error: test failed, to rerun pass `-p datafusion --test tpcds_planning`
I traced it down locally and apparently trying to format the deeply nested query was actually overflowing at this spot.
@@ -514,6 +517,35 @@ impl<S: ContextProvider> SqlToRel<'_, S> { | |||
return not_impl_err!("To not supported")?; | |||
} | |||
|
|||
// put the statement back together temporarily to get the SQL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this formulation is more code, it does avoid serializing the entire input string on every query, even when it is not needed
@@ -313,7 +313,7 @@ pub enum Expr { | |||
/// plan into physical plan. | |||
Wildcard { | |||
qualifier: Option<TableReference>, | |||
options: WildcardOptions, | |||
options: Box<WildcardOptions>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was needed to avoid a clippy lint about enum variants being too different. Specifically sqlparser added some new fields to WildCardOptions which made them substantially larger
239c18e
to
1e8d072
Compare
1e8d072
to
bd101da
Compare
504c04d
to
3ae39a5
Compare
} => self.show_columns_to_plan(extended, full, table_name, filter), | ||
show_options, | ||
} => { | ||
let ShowStatementOptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this checks @alamb I'm wondering if it caused by sql parser API extension or it technical debt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was caused by changes in the SQL Parser AST -- specifically I think it was introduced in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thanks @alamb
Thanks for the reviews @comphead (as always). Let's keep this code flowing 🚀 |
Which issue does this PR close?
Rationale for this change
Keep up with dependencies (in this case get access to source spans)
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?