mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 14:28:22 +00:00
BigQuery: Parse optional DELETE FROM
statement (#1120)
This commit is contained in:
parent
61089f977c
commit
df738f9b10
5 changed files with 120 additions and 27 deletions
|
@ -86,6 +86,30 @@ fn parse_raw_literal() {
|
|||
panic!("invalid query")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_delete_statement() {
|
||||
let sql = "DELETE \"table\" WHERE 1";
|
||||
match bigquery_and_generic().verified_stmt(sql) {
|
||||
Statement::Delete {
|
||||
from: FromTable::WithoutKeyword(from),
|
||||
..
|
||||
} => {
|
||||
assert_eq!(
|
||||
TableFactor::Table {
|
||||
name: ObjectName(vec![Ident::with_quote('"', "table")]),
|
||||
alias: None,
|
||||
args: None,
|
||||
with_hints: vec![],
|
||||
version: None,
|
||||
partitions: vec![],
|
||||
},
|
||||
from[0].relation
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_view_with_options() {
|
||||
let sql = concat!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue