iffyio commented on code in PR #2124:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2124#discussion_r2668924353
##########
tests/sqlparser_common.rs:
##########
@@ -17972,3 +17972,126 @@ fn parse_select_parenthesized_wildcard() {
assert_eq!(select2.projection.len(), 1);
assert!(matches!(select2.projection[0], SelectItem::Wildcard(_)));
}
+
+// https://docs.snowflake.com/en/user-guide/querying-semistructured
+#[test]
+fn parse_semi_structured_data_traversal() {
+ let dialects = TestedDialects::new(vec![
+ Box::new(GenericDialect {}),
+ Box::new(SnowflakeDialect {}),
+ ]);
Review Comment:
should this be all dialects instead? we don't seem to have special handling
for generic and snowflake
##########
tests/sqlparser_common.rs:
##########
@@ -17972,3 +17972,126 @@ fn parse_select_parenthesized_wildcard() {
assert_eq!(select2.projection.len(), 1);
assert!(matches!(select2.projection[0], SelectItem::Wildcard(_)));
}
+
+// https://docs.snowflake.com/en/user-guide/querying-semistructured
Review Comment:
```suggestion
```
##########
src/parser/mod.rs:
##########
@@ -3847,7 +3847,8 @@ impl<'a> Parser<'a> {
let lower_bound = if self.consume_token(&Token::Colon) {
None
} else {
- Some(self.parse_expr()?)
+ // parse expr until we hit a colon (or any token with lower
precedence)
+
Some(self.parse_subexpr(self.dialect.prec_value(Precedence::Colon))?)
Review Comment:
for the changes to the subscript behavior, we don't seem to have any new
tests to accompany them?
--
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]