iffyio commented on code in PR #2261:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2261#discussion_r2882909940


##########
src/parser/mod.rs:
##########
@@ -10257,6 +10266,14 @@ impl<'a> Parser<'a> {
                 column_position,
             }
         } else if self.parse_keyword(Keyword::ALTER) {
+            // Redshift: ALTER SORTKEY (column_list)

Review Comment:
   ```suggestion
   ```



##########
src/parser/mod.rs:
##########
@@ -10257,6 +10266,14 @@ impl<'a> Parser<'a> {
                 column_position,
             }
         } else if self.parse_keyword(Keyword::ALTER) {
+            // Redshift: ALTER SORTKEY (column_list)
+            if self.parse_keyword(Keyword::SORTKEY) {
+                self.expect_token(&Token::LParen)?;
+                let columns = self.parse_comma_separated(|p| p.parse_expr())?;
+                self.expect_token(&Token::RParen)?;
+                return Ok(AlterTableOperation::AlterSortKey { columns });
+            }

Review Comment:
   can we pull this out to its own function (the block is already quite  big)? 
we can do something like the following here to make the function self contained
   ```
   if self.peek(TOKEN::SORT_KEY) {
       self.prev_token(); // Put back the `ALTER` keyword
       return self.parse_alter_sort_key() 
   }



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