-
Notifications
You must be signed in to change notification settings - Fork 612
Snowflake: Support semi-structured data #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
7e7471e
2b43f30
4c1629d
498519a
283aa0a
7dde4b7
3598734
00d27d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1426,6 +1426,12 @@ impl<'a> Parser<'a> { | |
return self.parse_array_index(expr); | ||
} | ||
self.parse_map_access(expr) | ||
} else if Token::Colon == tok { | ||
Ok(Expr::JsonAccess { | ||
left: Box::new(expr), | ||
operator: JsonOperator::Colon, | ||
right: Box::new(Expr::Value(self.parse_value()?)), | ||
}) | ||
} else if Token::Arrow == tok | ||
|| Token::LongArrow == tok | ||
|| Token::HashArrow == tok | ||
|
@@ -1627,6 +1633,7 @@ impl<'a> Parser<'a> { | |
Token::Plus | Token::Minus => Ok(Self::PLUS_MINUS_PREC), | ||
Token::Mul | Token::Div | Token::Mod | Token::StringConcat => Ok(40), | ||
Token::DoubleColon => Ok(50), | ||
Token::Colon => Ok(50), | ||
Token::ExclamationMark => Ok(50), | ||
Token::LBracket | ||
| Token::LongArrow | ||
|
@@ -3441,6 +3448,9 @@ impl<'a> Parser<'a> { | |
Some('\'') => Ok(Value::SingleQuotedString(w.value)), | ||
_ => self.expected("A value?", Token::Word(w))?, | ||
}, | ||
Keyword::NoKeyword if dialect_of!(self is SnowflakeDialect) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yuval-illumex adding the generic here is feasible? I'd suggest adding it but, as identifiers have the same exact syntax, I don't know how that would work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AugustoFKL added :) |
||
Ok(Value::UnQuotedString(w.value)) | ||
} | ||
_ => self.expected("a concrete value", Token::Word(w)), | ||
}, | ||
// The call to n.parse() returns a bigdecimal when the | ||
|
Uh oh!
There was an error while loading. Please reload this page.