mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-25 16:34:04 +00:00
Snowflake: Minus char in stage name
This commit is contained in:
parent
376f47e3d1
commit
cb62618c41
2 changed files with 3 additions and 2 deletions
|
@ -1065,6 +1065,7 @@ pub fn parse_stage_name_identifier(parser: &mut Parser) -> Result<Ident, ParserE
|
||||||
Token::Mod => ident.push('%'),
|
Token::Mod => ident.push('%'),
|
||||||
Token::Div => ident.push('/'),
|
Token::Div => ident.push('/'),
|
||||||
Token::Plus => ident.push('+'),
|
Token::Plus => ident.push('+'),
|
||||||
|
Token::Minus => ident.push('-'),
|
||||||
Token::Number(n, _) => ident.push_str(n),
|
Token::Number(n, _) => ident.push_str(n),
|
||||||
Token::Word(w) => ident.push_str(&w.to_string()),
|
Token::Word(w) => ident.push_str(&w.to_string()),
|
||||||
_ => return parser.expected("stage name identifier", parser.peek_token()),
|
_ => return parser.expected("stage name identifier", parser.peek_token()),
|
||||||
|
|
|
@ -2663,7 +2663,7 @@ fn test_snowflake_copy_into() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test for non-ident characters in stage names
|
// 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);
|
assert_eq!(snowflake().verified_stmt(sql).to_string(), sql);
|
||||||
match snowflake().verified_stmt(sql) {
|
match snowflake().verified_stmt(sql) {
|
||||||
Statement::CopyIntoSnowflake { into, from_obj, .. } => {
|
Statement::CopyIntoSnowflake { into, from_obj, .. } => {
|
||||||
|
@ -2675,7 +2675,7 @@ fn test_snowflake_copy_into() {
|
||||||
from_obj,
|
from_obj,
|
||||||
Some(ObjectName::from(vec![
|
Some(ObjectName::from(vec![
|
||||||
Ident::new("@namespace"),
|
Ident::new("@namespace"),
|
||||||
Ident::new("stage_name/x@x~x%x+/20250723_data")
|
Ident::new("stage_name/x@x~x%x+/20250723_data-x")
|
||||||
]))
|
]))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue