preston-footprint opened a new issue, #2960:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/2960
`RedshiftSqlDialect` accepts `[` as a delimited identifier quote. In
Redshift, brackets after an expression index into a SUPER value, and
identifiers are quoted only with double quotes.
```sql
select a[pg_backend_pid() - pg_backend_pid()] from (select
json_parse('[1,2]') as a)
```
- sqlparser 0.64.0: `Word { value: "pg_backend_pid() - pg_backend_pid()",
quote_style: Some('[') }`; parses as `SELECT a AS [pg_backend_pid() -
pg_backend_pid()] FROM ...`.
- Redshift: returns `a = 1`, i.e. `a[0]`, so the bracket contents ran as an
expression.
Docs: SUPER navigation
(https://docs.aws.amazon.com/redshift/latest/dg/query-super.html) and
identifier rules (https://docs.aws.amazon.com/redshift/latest/dg/r_names.html).
--
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]