This is an automated email from the ASF dual-hosted git repository.

iffyio 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 bc478b05 Snowflake: Minus char in stage name (#2014)
bc478b05 is described below

commit bc478b0531c855cd6f53ff90c0aa964787090e69
Author: Yoav Cohen <59807311+yoavcl...@users.noreply.github.com>
AuthorDate: Tue Aug 26 22:25:10 2025 +0300

    Snowflake: Minus char in stage name (#2014)
---
 src/dialect/snowflake.rs     | 1 +
 tests/sqlparser_snowflake.rs | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/dialect/snowflake.rs b/src/dialect/snowflake.rs
index 07ef8317..3bb36010 100644
--- a/src/dialect/snowflake.rs
+++ b/src/dialect/snowflake.rs
@@ -1065,6 +1065,7 @@ pub fn parse_stage_name_identifier(parser: &mut Parser) 
-> Result<Ident, ParserE
             Token::Mod => ident.push('%'),
             Token::Div => ident.push('/'),
             Token::Plus => ident.push('+'),
+            Token::Minus => ident.push('-'),
             Token::Number(n, _) => ident.push_str(n),
             Token::Word(w) => ident.push_str(&w.to_string()),
             _ => return parser.expected("stage name identifier", 
parser.peek_token()),
diff --git a/tests/sqlparser_snowflake.rs b/tests/sqlparser_snowflake.rs
index 75e649fe..7c9e5261 100644
--- a/tests/sqlparser_snowflake.rs
+++ b/tests/sqlparser_snowflake.rs
@@ -2690,7 +2690,7 @@ fn test_snowflake_copy_into() {
     }
 
     // Test for non-ident characters in stage names
-    let sql = "COPY INTO a.b FROM 
@namespace.stage_name/x@x~x%x+/20250723_data";
+    let sql = "COPY INTO a.b FROM 
@namespace.stage_name/x@x~x%x+/20250723_data-x";
     assert_eq!(snowflake().verified_stmt(sql).to_string(), sql);
     match snowflake().verified_stmt(sql) {
         Statement::CopyIntoSnowflake { into, from_obj, .. } => {
@@ -2702,7 +2702,7 @@ fn test_snowflake_copy_into() {
                 from_obj,
                 Some(ObjectName::from(vec![
                     Ident::new("@namespace"),
-                    Ident::new("stage_name/x@x~x%x+/20250723_data")
+                    Ident::new("stage_name/x@x~x%x+/20250723_data-x")
                 ]))
             )
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@datafusion.apache.org
For additional commands, e-mail: commits-h...@datafusion.apache.org

Reply via email to