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

github-bot 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 9d5a171a Fixed stage name parsing for snowflake (#2265)
9d5a171a is described below

commit 9d5a171a85b06ca7df083287027d8620007f909b
Author: Andriy Romanov <[email protected]>
AuthorDate: Fri Mar 13 02:18:48 2026 -0700

    Fixed stage name parsing for snowflake (#2265)
---
 src/dialect/snowflake.rs     |  2 ++
 tests/sqlparser_snowflake.rs | 15 +++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/src/dialect/snowflake.rs b/src/dialect/snowflake.rs
index 6c160a9d..f0f33f8e 100644
--- a/src/dialect/snowflake.rs
+++ b/src/dialect/snowflake.rs
@@ -1258,6 +1258,8 @@ pub fn parse_stage_name_identifier(parser: &mut Parser) 
-> Result<Ident, ParserE
             Token::Div => ident.push('/'),
             Token::Plus => ident.push('+'),
             Token::Minus => ident.push('-'),
+            Token::Eq => ident.push('='),
+            Token::Colon => ident.push(':'),
             Token::Number(n, _) => ident.push_str(n),
             Token::Word(w) => ident.push_str(&w.to_string()),
             _ => return parser.expected_ref("stage name identifier", 
parser.peek_token_ref()),
diff --git a/tests/sqlparser_snowflake.rs b/tests/sqlparser_snowflake.rs
index 265f8a9a..0da44aa7 100644
--- a/tests/sqlparser_snowflake.rs
+++ b/tests/sqlparser_snowflake.rs
@@ -2640,6 +2640,21 @@ fn 
test_snowflake_copy_into_stage_name_ends_with_parens() {
     }
 }
 
+#[test]
+fn test_snowflake_stage_name_with_special_chars() {
+    // Stage path with '=' (Hive-style partitioning)
+    snowflake().verified_stmt("SELECT * FROM @stage/day=18/23.parquet");
+
+    // Stage path with ':' (time-based partitioning)
+    snowflake().verified_stmt("SELECT * FROM @stage/0:18:23/23.parquet");
+
+    // COPY INTO with '=' in stage path
+    snowflake().verified_stmt("COPY INTO my_table FROM 
@stage/day=18/file.parquet");
+
+    // COPY INTO with ':' in stage path
+    snowflake().verified_stmt("COPY INTO my_table FROM 
@stage/0:18:23/file.parquet");
+}
+
 #[test]
 fn test_snowflake_trim() {
     let real_sql = r#"SELECT customer_id, TRIM(sub_items.value:item_price_id, 
'"', "a") AS item_price_id FROM models_staging.subscriptions"#;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to