You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Dimchikkk (via GitHub)" <gi...@apache.org> on 2025/06/20 12:44:17 UTC
[I] Parse error for `limit` in subqueries [datafusion-sqlparser-rs]
Dimchikkk opened a new issue, #1898:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1898
```toml
[package]
name = "sqlparsertest"
version = "0.1.0"
edition = "2024"
[dependencies]
sqlparser055 = { package = "sqlparser", version = "0.55.0" }
sqlparser056 = { package = "sqlparser", version = "0.56.0" }
```
```rs
fn main() {
let sql = "SELECT t1_id, t1_name FROM t1 WHERE t1_id in (SELECT t2_id FROM t2 where t1_name = t2_name limit 10)";
{
use sqlparser055 as sqlparser;
match sqlparser::parser::Parser::parse_sql(&sqlparser::dialect::GenericDialect {}, sql) {
Ok(ast) => println!("0.55 AST: {:?}", ast),
Err(err) => eprintln!("0.55 Error: {}", err),
}
}
{
use sqlparser056 as sqlparser;
match sqlparser::parser::Parser::parse_sql(&sqlparser::dialect::GenericDialect {}, sql) {
Ok(ast) => println!("0.56 AST: {:?}", ast),
Err(err) => eprintln!("0.56 Error: {}", err),
}
}
}
```
```
~\dev\sqlparsertest> cargo run 06/20/2025 06:20:36 PM
Blocking waiting for file lock on build directory
Compiling sqlparsertest v0.1.0 (C:\Users\anakh\dev\sqlparsertest)
Finished `dev` profile [optimized + debuginfo] target(s) in 2.88s
Running `C:/Users/anakh/dev/.cargo-target\debug\sqlparsertest.exe`
0.55 AST: [Query(Query { with: None, body: Select(Select { select_token: TokenWithSpan { token: Word(Word { value: "SELECT", quote_style: None, keyword: SELECT }), span: Span(Location(1,1)..Location(1,7)) }, distinct: None, top: None, top_before_distinct: false, projection: [UnnamedExpr(Identifier(Ident { value: "t1_id", quote_style: None, span: Span(Location(1,8)..Location(1,13)) })), UnnamedExpr(Identifier(Ident { value: "t1_name", quote_style: None, span: Span(Location(1,15)..Location(1,22)) }))], into: None, from: [TableWithJoins { relation: Table { name: ObjectName([Identifier(Ident { value: "t1", quote_style: None, span: Span(Location(1,28)..Location(1,30)) })]), alias: None, args: None, with_hints: [], version: None, with_ordinality: false, partitions: [], json_path: None, sample: None, index_hints: [] }, joins: [] }], lateral_views: [], prewhere: None, selection: Some(InSubquery { expr: Identifier(Ident { value: "t1_id", quote_style: None, span: Span(Location(1,37)..Locati
on(1,42)) }), ....................................
0.56 Error: sql parser error: Expected: ), found: limit at Line: 1, Column: 92
```
--
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.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: [I] Parse error for `limit` in subqueries [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio closed issue #1898: Parse error for `limit` in subqueries
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1898
--
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