alpaylan commented on issue #3000:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/issues/3000#issuecomment-6987595705

   The same speculation (the typed-string `maybe_parse` at the top of 
`parse_prefix_inner`) also blows up in Snowflake, on nested `IDENTIFIER(...)`. 
Here the input parses. This is a regression from #1929; before it (0.57.0) the 
input parsed in microseconds:
   
   ```
   SELECT IDENTIFIER(IDENTIFIER(IDENTIFIER('t')))      -- nested n levels
           bytes   main      0.57.0
     n=16   202    75 ms    0.018 ms
     n=20   250   1.2 s     0.021 ms
     n=22   274   4.8 s     0.020 ms
   ```
   
   Same in `SELECT * FROM IDENTIFIER(...)` and `CREATE TABLE IDENTIFIER(...)`. 
The same input in GenericDialect is linear.
   
   ```rust
   use sqlparser::{dialect::SnowflakeDialect, parser::Parser};
   let sql = format!("SELECT {}'t'{}", "IDENTIFIER(".repeat(22), 
")".repeat(22));
   Parser::parse_sql(&SnowflakeDialect {}, &sql).unwrap(); // ~5 s
   ```
   
   Tested on main 9429cd30 and crates.io 0.64.0, 0.63.0 and 0.58.0 (the first 
release with #1929); 0.57.0 is linear.
   


-- 
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]

Reply via email to