Snowflake: DROP STREAM (#1973)
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run

This commit is contained in:
Yoav Cohen 2025-07-24 21:45:51 +03:00 committed by GitHub
parent 6a5ef48921
commit 145922affe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 0 deletions

View file

@ -7835,6 +7835,7 @@ pub enum ObjectType {
Stage, Stage,
Type, Type,
User, User,
Stream,
} }
impl fmt::Display for ObjectType { impl fmt::Display for ObjectType {
@ -7851,6 +7852,7 @@ impl fmt::Display for ObjectType {
ObjectType::Stage => "STAGE", ObjectType::Stage => "STAGE",
ObjectType::Type => "TYPE", ObjectType::Type => "TYPE",
ObjectType::User => "USER", ObjectType::User => "USER",
ObjectType::Stream => "STREAM",
}) })
} }
} }

View file

@ -870,6 +870,7 @@ define_keywords!(
STORAGE_SERIALIZATION_POLICY, STORAGE_SERIALIZATION_POLICY,
STORED, STORED,
STRAIGHT_JOIN, STRAIGHT_JOIN,
STREAM,
STRICT, STRICT,
STRING, STRING,
STRUCT, STRUCT,

View file

@ -6325,6 +6325,8 @@ impl<'a> Parser<'a> {
ObjectType::Type ObjectType::Type
} else if self.parse_keyword(Keyword::USER) { } else if self.parse_keyword(Keyword::USER) {
ObjectType::User ObjectType::User
} else if self.parse_keyword(Keyword::STREAM) {
ObjectType::Stream
} else if self.parse_keyword(Keyword::FUNCTION) { } else if self.parse_keyword(Keyword::FUNCTION) {
return self.parse_drop_function(); return self.parse_drop_function();
} else if self.parse_keyword(Keyword::POLICY) { } else if self.parse_keyword(Keyword::POLICY) {

View file

@ -16359,3 +16359,21 @@ fn parse_create_user() {
_ => unreachable!(), _ => unreachable!(),
} }
} }
#[test]
fn parse_drop_stream() {
let sql = "DROP STREAM s1";
match verified_stmt(sql) {
Statement::Drop {
names, object_type, ..
} => {
assert_eq!(
vec!["s1"],
names.iter().map(ToString::to_string).collect::<Vec<_>>()
);
assert_eq!(ObjectType::Stream, object_type);
}
_ => unreachable!(),
}
verified_stmt("DROP STREAM IF EXISTS s1");
}