You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@datafusion.apache.org by "tomershaniii (via GitHub)" <gi...@apache.org> on 2024/10/09 11:21:41 UTC
[PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
tomershaniii opened a new pull request, #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datafusion.apache.org
For additional commands, e-mail: dev-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464#issuecomment-2417320529
Looks like a CI check is failing on this PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464#discussion_r1803437297
##########
src/parser/mod.rs:
##########
@@ -3510,16 +3510,19 @@ impl<'a> Parser<'a> {
/// Run a parser method `f`, reverting back to the current position if unsuccessful.
#[must_use]
- pub fn maybe_parse<T, F>(&mut self, mut f: F) -> Option<T>
+ pub fn maybe_parse<T, F>(&mut self, mut f: F) -> Result<Option<T>, ParserError>
where
F: FnMut(&mut Parser) -> Result<T, ParserError>,
{
let index = self.index;
- if let Ok(t) = f(self) {
- Some(t)
- } else {
- self.index = index;
- None
+ match f(self) {
+ Ok(t) => Ok(Some(t)),
+ // Unwind stack if limit exceeded
+ Err(ParserError::RecursionLimitExceeded) => Err(ParserError::RecursionLimitExceeded),
Review Comment:
👍
##########
src/ast/mod.rs:
##########
@@ -3191,7 +3191,7 @@ pub enum Statement {
/// Table confs
options: Vec<SqlOption>,
/// Cache table as a Query
- query: Option<Query>,
+ query: Option<Box<Query>>,
Review Comment:
this is a nice change
##########
src/ast/query.rs:
##########
@@ -1103,7 +1103,7 @@ pub enum PivotValueSource {
/// Pivot on all values returned by a subquery.
///
/// See <https://docs.snowflake.com/en/sql-reference/constructs/pivot#pivot-on-column-values-using-a-subquery-with-dynamic-pivot>.
- Subquery(Query),
+ Subquery(Box<Query>),
Review Comment:
👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "coveralls (via GitHub)" <gi...@apache.org>.
coveralls commented on PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464#issuecomment-2417329966
## Pull Request Test Coverage Report for [Build 11331117620](https://coveralls.io/builds/70369791)
### Warning: This coverage report may be inaccurate.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
- For more information on this, see <a target="_blank" href="https://docs.coveralls.io/build-types#tracking-coverage-changes-with-pull_request-builds">Tracking coverage changes with pull request builds</a>.
- To avoid this issue with future PRs, see these <a target="_blank" href="https://docs.coveralls.io/build-types#recommended-ci-configurations">Recommended CI Configurations</a>.
- For a quick fix, <a target="_blank" href="https://github.blog/changelog/2022-02-03-more-ways-to-keep-your-pull-request-branch-up-to-date/#update-your-pull-request-branch-by-rebasing">rebase this PR at GitHub</a>. Your next report should be accurate.
### Details
* **274** of **276** **(99.28%)** changed or added relevant lines in **16** files are covered.
* **4** unchanged lines in **1** file lost coverage.
* Overall coverage increased (+**0.001%**) to **89.317%**
---
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
| :-----|--------------|--------|---: |
| [src/parser/mod.rs](https://coveralls.io/builds/70369791/source?filename=src%2Fparser%2Fmod.rs#L8760) | 59 | 61 | 96.72%
<!-- | **Total:** | **274** | **276** | **99.28%** | -->
| Files with Coverage Reduction | New Missed Lines | % |
| :-----|--------------|--: |
| [tests/sqlparser_common.rs](https://coveralls.io/builds/70369791/source?filename=tests%2Fsqlparser_common.rs#L1271) | 4 | 89.56% |
<!-- | **Total:** | **4** | | -->
| Totals | [](https://coveralls.io/builds/70369791) |
| :-- | --: |
| Change from base [Build 11294882452](https://coveralls.io/builds/70294044): | 0.001% |
| Covered Lines: | 30081 |
| Relevant Lines: | 33679 |
---
##### 💛 - [Coveralls](https://coveralls.io)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "tomershaniii (via GitHub)" <gi...@apache.org>.
tomershaniii commented on PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464#issuecomment-2424729730
Build broken by another commit, please re-run CI
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "tomershaniii (via GitHub)" <gi...@apache.org>.
tomershaniii commented on PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464#issuecomment-2420349550
CI issues fixed, please re-run
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464#issuecomment-2425207532
🤔 CI is still failing unfortunately
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "tomershaniii (via GitHub)" <gi...@apache.org>.
tomershaniii commented on PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464#issuecomment-2426647877
yet another rebase fix @alamb plz...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464#issuecomment-2427569830
Thanks for sticking with this @tomershaniii and for the review @iffyio
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "tomershaniii (via GitHub)" <gi...@apache.org>.
tomershaniii commented on PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464#issuecomment-2411688645
@iffyio took some yack shaving but it's finally here :-) check out `test_parentheses_overflow`
Some context for the other changes:
- the parse_boxed variants were doing the boxing when exiting the recursion, which resulted in unreasonable low number of stack frames before overflowing, in the PRs i removed the `parse_boxed` functions and added native boxing to the respective `parse_` functions
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464#issuecomment-2427569473
🚀
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix for maybe_parse preventing parser from erroring on recursion limit [datafusion-sqlparser-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #1464:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1464
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org