Dimchikkk opened a new issue, #1904:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1904
```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 = r#"SELECT *
FROM t1
NATURAL JOIN t5
INNER JOIN t0 ON (t0.v1 + t5.v0) > 0
WHERE t0.v1 = t1.v0;"#;
println!("--- SQL ---\n{}\n", sql);
{
use sqlparser055 as sqlparser;
use sqlparser::dialect::GenericDialect;
use sqlparser::parser::Parser;
println!("--- sqlparser 0.55 ---");
match Parser::parse_sql(&GenericDialect {}, sql) {
Ok(statements) => {
for stmt in &statements {
println!("Full statement (SQL): {}", stmt); // whole
query as SQL string
}
for stmt in statements {
if let sqlparser::ast::Statement::Query(query) = stmt {
if let sqlparser::ast::SetExpr::Select(select) =
&*query.body {
for tbl in &select.from {
println!("joins (debug): {:?}", tbl.joins);
println!("joins (SQL): {}", tbl); // print
TableWithJoins as SQL string
}
}
}
}
}
Err(err) => eprintln!("Error: {}", err),
}
}
{
use sqlparser056 as sqlparser;
use sqlparser::dialect::GenericDialect;
use sqlparser::parser::Parser;
println!("\n--- sqlparser 0.56 ---");
match Parser::parse_sql(&GenericDialect {}, sql) {
Ok(statements) => {
for stmt in &statements {
println!("Full statement (SQL): {}", stmt);
}
for stmt in statements {
if let sqlparser::ast::Statement::Query(query) = stmt {
if let sqlparser::ast::SetExpr::Select(select) =
&*query.body {
for tbl in &select.from {
println!("joins (debug): {:?}", tbl.joins);
println!("joins (SQL): {}", tbl);
}
}
}
}
}
Err(err) => eprintln!("Error: {}", err),
}
}
}
```

(since version 0.56, the parser changed how it interprets join precedence by
introducing support for nested joins without parentheses, aligning with
Snowflake-specific behavior)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]