Skip to content

Commit

Permalink
Support INSERT OVERWRITE INTO syntax (#1584)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuval-illumex authored Dec 9, 2024
1 parent d0fcc06 commit 00abaf2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11291,9 +11291,8 @@ impl<'a> Parser<'a> {

let replace_into = false;

let action = self.parse_one_of_keywords(&[Keyword::INTO, Keyword::OVERWRITE]);
let into = action == Some(Keyword::INTO);
let overwrite = action == Some(Keyword::OVERWRITE);
let overwrite = self.parse_keyword(Keyword::OVERWRITE);
let into = self.parse_keyword(Keyword::INTO);

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

Expand Down
6 changes: 6 additions & 0 deletions tests/sqlparser_snowflake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2952,3 +2952,9 @@ fn test_sf_double_dot_notation() {

#[test]
fn test_parse_double_dot_notation_wrong_position() {}

#[test]
fn parse_insert_overwrite() {
let insert_overwrite_into = r#"INSERT OVERWRITE INTO schema.table SELECT a FROM b"#;
snowflake().verified_stmt(insert_overwrite_into);
}

0 comments on commit 00abaf2

Please sign in to comment.