BigQuery: Parse optional DELETE FROM statement (#1120)

This commit is contained in:
Ifeanyi Ubah 2024-02-04 14:57:33 +01:00 committed by GitHub
parent 61089f977c
commit df738f9b10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 120 additions and 27 deletions

View file

@ -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!(