-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Show current SQL recursion limit in RecursionLimitExceeded error message #15644
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
base: main
Are you sure you want to change the base?
Show current SQL recursion limit in RecursionLimitExceeded error message #15644
Conversation
4ed10ff
to
93f771e
Compare
datafusion/sql/src/parser.rs
Outdated
Err(ParserError::RecursionLimitExceeded) => { | ||
Err(ParserError::ParserError(format!( | ||
"recursion limit exceeded (current limit: {})", | ||
self.recursion_limit |
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.
wondering, can we take it from config?
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.
Updated 91da480
I tried to associate SQLParser
options with DFParser
struct, instead of only keeping a direct mapping between recursion_limit
and DFParser
. This way DFParser
would've access to same recursion_limit
setting that was used while building the DFParser.
Thoughts?
datafusion/sql/src/parser.rs
Outdated
self.parser.parse_statement()?, | ||
))) | ||
match self.parser.parse_statement() { | ||
Ok(stmt) => Ok(Statement::Statement(Box::from(stmt))), |
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.
we probably can do this more concise
sort of
self.parser.parse_statement().map(
|stmt| Statement::Statement(Box::new(stmt))
).map_err(|e| match e {
ParserError::RecursionLimitExceeded => ParserError::ParserError(format!(
"recursion limit exceeded (current limit: {})",
self.recursion_limit
)),
other => other,
})
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.
Updated 91da480
Which issue does this PR close?
Rationale for this change
What changes are included in this PR?
recursion_limit
field toDFParser
struct to track the current recursion limitCOPY INTO
statementssql parser error: recursion limit exceeded (current limit: {recursion_limit})
Are these changes tested?
Are there any user-facing changes?