Open yoavcloud opened 3 weeks ago
The solution outline I'm thinking about is to try to parse the expression but if that results in an error, try to parse an identifier, if the keyword is not reserved by the dialect.
For the query above, Snowflake doesn't reserve the INTERVAL keyword so it can be used as an identifier without quoting, but BigQuery does.
PR to fix this: https://github.com/apache/datafusion-sqlparser-rs/pull/1513
When a statement uses identifiers that match certain expression prefix keywords, the parser will try to parse the expression over parsing the token as an identifier. The following statements work on Snowflake but the parser errors on the SELECT. If a different identifier name is selected, for example,
interval1
then the parser works as expected.