7phs commented on code in PR #1576:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1576#discussion_r1870465243
##########
src/dialect/redshift.rs:
##########
@@ -41,10 +41,24 @@ impl Dialect for RedshiftSqlDialect {
/// treating them as json path. If there is identifier then we assume
/// there is no json path.
fn is_proper_identifier_inside_quotes(&self, mut chars:
Peekable<Chars<'_>>) -> bool {
+ // PartiQL (used as json path query language in Redshift) uses square
bracket as
+ // a start character and a quote is a beginning of quoted identifier.
+ // Skipping analyzing token such as `"a"` and analyze only token that
+ // can be part of json path potentially.
+ // For ex., `[0]`, `['a']` (seems part of json path) or `["a"]`
(normal quoted identifier)
+ if let Some(quote_start) = chars.peek() {
+ if *quote_start == '"' {
+ return true;
+ }
+ };
Review Comment:
I added more unit-tests and updated a code of tokeniser to handle mentioned
edge cases.
--
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]