mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Support snowflake double dot notation for object name (#1540)
This commit is contained in:
parent
96f7c0277a
commit
f4f112d7d6
4 changed files with 57 additions and 0 deletions
|
@ -2866,3 +2866,35 @@ fn test_projection_with_nested_trailing_commas() {
|
|||
let sql = "SELECT a, b, FROM c, (SELECT d, e, FROM f, LATERAL FLATTEN(input => events))";
|
||||
let _ = snowflake().parse_sql_statements(sql).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_sf_double_dot_notation() {
|
||||
snowflake().verified_stmt("SELECT * FROM db_name..table_name");
|
||||
snowflake().verified_stmt("SELECT * FROM x, y..z JOIN a..b AS b ON x.id = b.id");
|
||||
|
||||
assert_eq!(
|
||||
snowflake()
|
||||
.parse_sql_statements("SELECT * FROM X.Y..")
|
||||
.unwrap_err()
|
||||
.to_string(),
|
||||
"sql parser error: Expected: identifier, found: ."
|
||||
);
|
||||
assert_eq!(
|
||||
snowflake()
|
||||
.parse_sql_statements("SELECT * FROM X..Y..Z")
|
||||
.unwrap_err()
|
||||
.to_string(),
|
||||
"sql parser error: Expected: identifier, found: ."
|
||||
);
|
||||
assert_eq!(
|
||||
// Ensure we don't parse leading token
|
||||
snowflake()
|
||||
.parse_sql_statements("SELECT * FROM .X.Y")
|
||||
.unwrap_err()
|
||||
.to_string(),
|
||||
"sql parser error: Expected: identifier, found: ."
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_double_dot_notation_wrong_position() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue