alpaylan opened a new issue, #3002:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/3002
Unclosed nested qualified calls whose argument is `name = value` (or `name
:= value`) double the parse time per level in DuckDB. Before #2685 (0.63.0) the
same input failed in microseconds:
```
SELECT u.u(k=u.u(k=u.u(k=1 -- nested n levels, no closing
parentheses
bytes main 0.63.0
n=16 104 197 ms 0.034 ms
n=20 128 3.1 s 0.032 ms
n=22 140 12.7 s 0.037 ms
```
The closed form, the unqualified form `u(k=u(k=...1` and other dialects stay
linear.
```rust
use sqlparser::{dialect::DuckDbDialect, parser::Parser};
let sql = format!("SELECT {}1", "u.u(k=".repeat(22));
let _ = Parser::parse_sql(&DuckDbDialect {}, &sql); // error after ~13 s
```
Tested on main 9429cd30 and crates.io 0.64.0 and 0.63.0.
Found with a coverage-guided performance fuzzer; I used AI assistance for
triage and verified every case above.
--
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]