Add support for + char in Snowflake stage names (#1935)
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run

This commit is contained in:
Yoav Cohen 2025-07-10 18:01:08 +02:00 committed by GitHub
parent 8f1414efff
commit fd4934ec74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View file

@ -735,6 +735,7 @@ pub fn parse_stage_name_identifier(parser: &mut Parser) -> Result<Ident, ParserE
Token::Tilde => ident.push('~'),
Token::Mod => ident.push('%'),
Token::Div => ident.push('/'),
Token::Plus => ident.push('+'),
Token::Word(w) => ident.push_str(&w.to_string()),
_ => return parser.expected("stage name identifier", parser.peek_token()),
}

View file

@ -2581,6 +2581,26 @@ fn test_snowflake_copy_into() {
}
_ => unreachable!(),
}
// Test for non-ident characters in stage names
let sql = "COPY INTO a.b FROM @namespace.stage_name/x@x~x%x+";
assert_eq!(snowflake().verified_stmt(sql).to_string(), sql);
match snowflake().verified_stmt(sql) {
Statement::CopyIntoSnowflake { into, from_obj, .. } => {
assert_eq!(
into,
ObjectName::from(vec![Ident::new("a"), Ident::new("b")])
);
assert_eq!(
from_obj,
Some(ObjectName::from(vec![
Ident::new("@namespace"),
Ident::new("stage_name/x@x~x%x+")
]))
)
}
_ => unreachable!(),
}
}
#[test]