mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-08 13:10:20 +00:00
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
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:
parent
6a5ef48921
commit
145922affe
4 changed files with 23 additions and 0 deletions
|
@ -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",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue