mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-03 22:08:16 +00:00
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
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:
parent
8f1414efff
commit
fd4934ec74
2 changed files with 21 additions and 0 deletions
|
@ -735,6 +735,7 @@ pub fn parse_stage_name_identifier(parser: &mut Parser) -> Result<Ident, ParserE
|
||||||
Token::Tilde => ident.push('~'),
|
Token::Tilde => ident.push('~'),
|
||||||
Token::Mod => ident.push('%'),
|
Token::Mod => ident.push('%'),
|
||||||
Token::Div => ident.push('/'),
|
Token::Div => ident.push('/'),
|
||||||
|
Token::Plus => ident.push('+'),
|
||||||
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()),
|
||||||
}
|
}
|
||||||
|
|
|
@ -2581,6 +2581,26 @@ fn test_snowflake_copy_into() {
|
||||||
}
|
}
|
||||||
_ => unreachable!(),
|
_ => 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]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue