@@ -10878,6 +10878,18 @@ impl<'a> Parser<'a> {
1087810878 Ok(AlterTableOperation::AlterSortKey { columns })
1087910879 }
1088010880
10881+ /// Peek whether the upcoming tokens are a bare `<identifier> COMMENT ...`
10882+ /// continuation of a comma-separated `ALTER COLUMN ... COMMENT` list, i.e.
10883+ /// with the `COLUMN` keyword omitted. This shape is unambiguous against
10884+ /// every other `ALTER TABLE` operation, which are all keyword-led.
10885+ fn peek_bare_column_comment_continuation(&self) -> bool {
10886+ matches!(self.peek_nth_token(0).token, Token::Word(_))
10887+ && matches!(
10888+ self.peek_nth_token(1).token,
10889+ Token::Word(w) if w.keyword == Keyword::COMMENT
10890+ )
10891+ }
10892+
1088110893 /// Parse a single `ALTER TABLE` operation and return an `AlterTableOperation`.
1088210894 pub fn parse_alter_table_operation(&mut self) -> Result<AlterTableOperation, ParserError> {
1088310895 let operation = if self.parse_keyword(Keyword::ADD) {
@@ -11191,11 +11203,14 @@ impl<'a> Parser<'a> {
1119111203 column_position,
1119211204 }
1119311205 } else if self.dialect.supports_alter_column_comment()
11194- && self.parse_keyword(Keyword::COLUMN)
11206+ && (self.parse_keyword(Keyword::COLUMN)
11207+ || self.peek_bare_column_comment_continuation())
1119511208 {
1119611209 // Continuation of a comma-separated `ALTER COLUMN ... COMMENT` list,
1119711210 // e.g. `... ALTER COLUMN c1 COMMENT 's1', COLUMN c2 COMMENT 's2'`.
11198- // The second and later items carry `COLUMN` without a leading `ALTER`.
11211+ // The second and later items carry `COLUMN` without a leading `ALTER`,
11212+ // and Snowflake also accepts the bare form with `COLUMN` omitted:
11213+ // `... ALTER c1 COMMENT 's1', c2 COMMENT 's2'`.
1119911214 let column_name = self.parse_identifier()?;
1120011215 self.expect_keyword_is(Keyword::COMMENT)?;
1120111216 AlterTableOperation::AlterColumn {
0 commit comments