framlog commented on code in PR #1476:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1476#discussion_r1806679044


##########
src/parser/mod.rs:
##########
@@ -7156,6 +7156,33 @@ impl<'a> Parser<'a> {
                 partition,
                 with_name,
             }
+        } else if self.dialect.supports_alter_table_update() && 
self.parse_keyword(Keyword::UPDATE)
+        {
+            let mut assignments = vec![];
+            loop {
+                let target = self.parse_assignment_target()?;
+                self.expect_token(&Token::Eq)?;
+                let value = 
self.parse_subexpr(self.dialect.prec_value(Precedence::Between))?;

Review Comment:
   Yep, `self.parse_assignment()` fails to parse SQLs like `... UPDATE c = 1 IN 
PARTITION ...` due to it's not look ahead enough before parsing expressions. 
It's the same reason that I can't use `parse_comma_separated` as well. 
   
   Also, I have to mention that there may still have bugs when parsing 
something like `... UPDATE c = 1 in [1,2,3] IN PARTITION ...`, which's valid in 
clickhouse. The good news is it throws errors instead of paring them into wrong 
ASTs.
   



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