kfirSatori commented on code in PR #2359:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2359#discussion_r3774901798


##########
src/parser/mod.rs:
##########
@@ -13036,6 +13036,31 @@ impl<'a> Parser<'a> {
                     let fields = self.parse_union_type_def()?;
                     Ok(DataType::Union(fields))
                 }
+                Keyword::OBJECT if dialect_is!(dialect is SnowflakeDialect | 
GenericDialect) => {
+                    self.prev_token();
+                    self.expect_keyword_is(Keyword::OBJECT)?;
+                    // Object type may have no fields: OBJECT or OBJECT()
+                    if !self.peek_token_ref().token.eq(&Token::LParen) {
+                        Ok(DataType::Object(vec![]))
+                    } else {
+                        self.expect_token(&Token::LParen)?;
+                        let fields = if self.peek_token_ref().token == 
Token::RParen {
+                            vec![]
+                        } else {
+                            self.parse_comma_separated(|parser| {
+                                let field_name = parser.parse_identifier()?;
+                                let field_type = parser.parse_data_type()?;
+                                Ok(StructField {
+                                    field_name: Some(field_name),
+                                    field_type,
+                                    options: None,
+                                })
+                            })?
+                        };
+                        self.expect_token(&Token::RParen)?;

Review Comment:
   @iffyio done :)



-- 
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]

Reply via email to