mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-03 13:58:15 +00:00
feat: support byte string literal in bq (#802)
* rebase * review * lint
This commit is contained in:
parent
c35dcc93a7
commit
0c0d088ec2
4 changed files with 58 additions and 1 deletions
|
@ -32,6 +32,24 @@ fn parse_literal_string() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_byte_literal() {
|
||||
let sql = r#"SELECT B'abc', B"abc""#;
|
||||
let select = bigquery().verified_only_select(sql);
|
||||
assert_eq!(2, select.projection.len());
|
||||
assert_eq!(
|
||||
&Expr::Value(Value::SingleQuotedByteStringLiteral("abc".to_string())),
|
||||
expr_from_projection(&select.projection[0])
|
||||
);
|
||||
assert_eq!(
|
||||
&Expr::Value(Value::DoubleQuotedByteStringLiteral("abc".to_string())),
|
||||
expr_from_projection(&select.projection[1])
|
||||
);
|
||||
|
||||
let sql = r#"SELECT b'abc', b"abc""#;
|
||||
bigquery().one_statement_parses_to(sql, r#"SELECT B'abc', B"abc""#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_table_identifiers() {
|
||||
fn test_table_ident(ident: &str, expected: Vec<Ident>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue