This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 00abaf21 Support INSERT OVERWRITE INTO syntax (#1584)
00abaf21 is described below
commit 00abaf218735b6003af6eb4f482d6a6e2659a12c
Author: Yuval Shkolar <[email protected]>
AuthorDate: Mon Dec 9 22:25:10 2024 +0200
Support INSERT OVERWRITE INTO syntax (#1584)
---
src/parser/mod.rs | 5 ++---
tests/sqlparser_snowflake.rs | 6 ++++++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/parser/mod.rs b/src/parser/mod.rs
index ac76f648..e47e71b4 100644
--- a/src/parser/mod.rs
+++ b/src/parser/mod.rs
@@ -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);
diff --git a/tests/sqlparser_snowflake.rs b/tests/sqlparser_snowflake.rs
index 3cbd87bf..5ad861f4 100644
--- a/tests/sqlparser_snowflake.rs
+++ b/tests/sqlparser_snowflake.rs
@@ -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);
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]