Skip to content

Commit 00abaf2

Browse files
Support INSERT OVERWRITE INTO syntax (#1584)
1 parent d0fcc06 commit 00abaf2

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/parser/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -11291,9 +11291,8 @@ impl<'a> Parser<'a> {
1129111291

1129211292
let replace_into = false;
1129311293

11294-
let action = self.parse_one_of_keywords(&[Keyword::INTO, Keyword::OVERWRITE]);
11295-
let into = action == Some(Keyword::INTO);
11296-
let overwrite = action == Some(Keyword::OVERWRITE);
11294+
let overwrite = self.parse_keyword(Keyword::OVERWRITE);
11295+
let into = self.parse_keyword(Keyword::INTO);
1129711296

1129811297
let local = self.parse_keyword(Keyword::LOCAL);
1129911298

tests/sqlparser_snowflake.rs

+6
Original file line numberDiff line numberDiff line change
@@ -2952,3 +2952,9 @@ fn test_sf_double_dot_notation() {
29522952

29532953
#[test]
29542954
fn test_parse_double_dot_notation_wrong_position() {}
2955+
2956+
#[test]
2957+
fn parse_insert_overwrite() {
2958+
let insert_overwrite_into = r#"INSERT OVERWRITE INTO schema.table SELECT a FROM b"#;
2959+
snowflake().verified_stmt(insert_overwrite_into);
2960+
}

0 commit comments

Comments
 (0)