Skip to content

Commit 8874844

Browse files
Merge branch 'main' into main
2 parents e4ddb24 + 1b842d3 commit 8874844

File tree

15 files changed

+1024
-555
lines changed

15 files changed

+1024
-555
lines changed

src/ast/ddl.rs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,15 @@ pub enum AlterTableOperation {
371371
DropClusteringKey,
372372
SuspendRecluster,
373373
ResumeRecluster,
374-
/// `REFRESH`
374+
/// `REFRESH [ '<subpath>' ]`
375375
///
376-
/// Note: this is Snowflake specific for dynamic tables <https://docs.snowflake.com/en/sql-reference/sql/alter-table>
377-
Refresh,
376+
/// Note: this is Snowflake specific for dynamic/external tables
377+
/// <https://docs.snowflake.com/en/sql-reference/sql/alter-dynamic-table>
378+
/// <https://docs.snowflake.com/en/sql-reference/sql/alter-external-table>
379+
Refresh {
380+
/// Optional subpath for external table refresh
381+
subpath: Option<String>,
382+
},
378383
/// `SUSPEND`
379384
///
380385
/// Note: this is Snowflake specific for dynamic tables <https://docs.snowflake.com/en/sql-reference/sql/alter-table>
@@ -863,8 +868,12 @@ impl fmt::Display for AlterTableOperation {
863868
write!(f, "RESUME RECLUSTER")?;
864869
Ok(())
865870
}
866-
AlterTableOperation::Refresh => {
867-
write!(f, "REFRESH")
871+
AlterTableOperation::Refresh { subpath } => {
872+
write!(f, "REFRESH")?;
873+
if let Some(path) = subpath {
874+
write!(f, " '{path}'")?;
875+
}
876+
Ok(())
868877
}
869878
AlterTableOperation::Suspend => {
870879
write!(f, "SUSPEND")
@@ -3977,8 +3986,11 @@ pub enum AlterTableType {
39773986
/// <https://docs.snowflake.com/en/sql-reference/sql/alter-iceberg-table>
39783987
Iceberg,
39793988
/// Dynamic table type
3980-
/// <https://docs.snowflake.com/en/sql-reference/sql/alter-table>
3989+
/// <https://docs.snowflake.com/en/sql-reference/sql/alter-dynamic-table>
39813990
Dynamic,
3991+
/// External table type
3992+
/// <https://docs.snowflake.com/en/sql-reference/sql/alter-external-table>
3993+
External,
39823994
}
39833995

39843996
/// ALTER TABLE statement
@@ -4008,6 +4020,7 @@ impl fmt::Display for AlterTable {
40084020
match &self.table_type {
40094021
Some(AlterTableType::Iceberg) => write!(f, "ALTER ICEBERG TABLE ")?,
40104022
Some(AlterTableType::Dynamic) => write!(f, "ALTER DYNAMIC TABLE ")?,
4023+
Some(AlterTableType::External) => write!(f, "ALTER EXTERNAL TABLE ")?,
40114024
None => write!(f, "ALTER TABLE ")?,
40124025
}
40134026

0 commit comments

Comments
 (0)