File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7864,6 +7864,7 @@ pub enum ObjectType {
78647864 Stage ,
78657865 Type ,
78667866 User ,
7867+ Stream ,
78677868}
78687869
78697870impl fmt:: Display for ObjectType {
@@ -7880,6 +7881,7 @@ impl fmt::Display for ObjectType {
78807881 ObjectType :: Stage => "STAGE" ,
78817882 ObjectType :: Type => "TYPE" ,
78827883 ObjectType :: User => "USER" ,
7884+ ObjectType :: Stream => "STREAM" ,
78837885 } )
78847886 }
78857887}
Original file line number Diff line number Diff line change @@ -870,6 +870,7 @@ define_keywords!(
870870 STORAGE_SERIALIZATION_POLICY ,
871871 STORED ,
872872 STRAIGHT_JOIN ,
873+ STREAM ,
873874 STRICT ,
874875 STRING ,
875876 STRUCT ,
Original file line number Diff line number Diff line change @@ -6356,6 +6356,8 @@ impl<'a> Parser<'a> {
63566356 ObjectType::Type
63576357 } else if self.parse_keyword(Keyword::USER) {
63586358 ObjectType::User
6359+ } else if self.parse_keyword(Keyword::STREAM) {
6360+ ObjectType::Stream
63596361 } else if self.parse_keyword(Keyword::FUNCTION) {
63606362 return self.parse_drop_function();
63616363 } else if self.parse_keyword(Keyword::POLICY) {
Original file line number Diff line number Diff line change @@ -16385,3 +16385,21 @@ fn parse_create_user() {
1638516385 _ => unreachable!(),
1638616386 }
1638716387}
16388+
16389+ #[test]
16390+ fn parse_drop_stream() {
16391+ let sql = "DROP STREAM s1";
16392+ match verified_stmt(sql) {
16393+ Statement::Drop {
16394+ names, object_type, ..
16395+ } => {
16396+ assert_eq!(
16397+ vec!["s1"],
16398+ names.iter().map(ToString::to_string).collect::<Vec<_>>()
16399+ );
16400+ assert_eq!(ObjectType::Stream, object_type);
16401+ }
16402+ _ => unreachable!(),
16403+ }
16404+ verified_stmt("DROP STREAM IF EXISTS s1");
16405+ }
You can’t perform that action at this time.
0 commit comments