ayman-sigma commented on code in PR #1542:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1542#discussion_r1855276709
##########
src/parser/mod.rs:
##########
@@ -2328,19 +2327,25 @@ impl<'a> Parser<'a> {
}
}
- /// Bigquery specific: Parse a struct literal
/// Syntax
/// ```sql
- /// -- typed
+ /// -- typed, specific to bigquery
/// STRUCT<[field_name] field_type, ...>( expr1 [, ... ])
/// -- typeless
/// STRUCT( expr1 [AS field_name] [, ... ])
/// ```
- fn parse_bigquery_struct_literal(&mut self) -> Result<Expr, ParserError> {
- let (fields, trailing_bracket) =
- self.parse_struct_type_def(Self::parse_struct_field_def)?;
- if trailing_bracket.0 {
- return parser_err!("unmatched > in STRUCT literal",
self.peek_token().location);
+ fn parse_struct_literal(&mut self) -> Result<Expr, ParserError> {
+ let mut fields = vec![];
+ // Typed struct syntax is only supported by BigQuery
+ //
https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#typed_struct_syntax
+ if self.dialect.supports_typed_struct_syntax() {
Review Comment:
done as suggested.
--
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]