mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-12-23 11:12:51 +00:00
Snowflake ALTER TABLE clustering options (#1579)
This commit is contained in:
parent
7b50ac31c3
commit
d0fcc06652
5 changed files with 123 additions and 15 deletions
|
|
@ -7273,6 +7273,8 @@ impl<'a> Parser<'a> {
|
|||
let if_exists = self.parse_keywords(&[Keyword::IF, Keyword::EXISTS]);
|
||||
let name = self.parse_identifier(false)?;
|
||||
AlterTableOperation::DropProjection { if_exists, name }
|
||||
} else if self.parse_keywords(&[Keyword::CLUSTERING, Keyword::KEY]) {
|
||||
AlterTableOperation::DropClusteringKey
|
||||
} else {
|
||||
let _ = self.parse_keyword(Keyword::COLUMN); // [ COLUMN ]
|
||||
let if_exists = self.parse_keywords(&[Keyword::IF, Keyword::EXISTS]);
|
||||
|
|
@ -7444,6 +7446,15 @@ impl<'a> Parser<'a> {
|
|||
partition,
|
||||
with_name,
|
||||
}
|
||||
} else if self.parse_keywords(&[Keyword::CLUSTER, Keyword::BY]) {
|
||||
self.expect_token(&Token::LParen)?;
|
||||
let exprs = self.parse_comma_separated(|parser| parser.parse_expr())?;
|
||||
self.expect_token(&Token::RParen)?;
|
||||
AlterTableOperation::ClusterBy { exprs }
|
||||
} else if self.parse_keywords(&[Keyword::SUSPEND, Keyword::RECLUSTER]) {
|
||||
AlterTableOperation::SuspendRecluster
|
||||
} else if self.parse_keywords(&[Keyword::RESUME, Keyword::RECLUSTER]) {
|
||||
AlterTableOperation::ResumeRecluster
|
||||
} else {
|
||||
let options: Vec<SqlOption> =
|
||||
self.parse_options_with_keywords(&[Keyword::SET, Keyword::TBLPROPERTIES])?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue