mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-24 07:54:06 +00:00
Add support for VACUUM in Redshift (#2005)
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
cb7a51e85f
commit
e9eee00ed9
5 changed files with 138 additions and 0 deletions
|
@ -407,3 +407,48 @@ fn parse_string_literal_backslash_escape() {
|
|||
fn parse_utf8_multibyte_idents() {
|
||||
redshift().verified_stmt("SELECT 🚀.city AS 🎸 FROM customers AS 🚀");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_vacuum() {
|
||||
let stmt = redshift().verified_stmt("VACUUM FULL");
|
||||
match stmt {
|
||||
Statement::Vacuum(v) => {
|
||||
assert!(v.full);
|
||||
assert_eq!(v.table_name, None);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
let stmt = redshift().verified_stmt("VACUUM tbl");
|
||||
match stmt {
|
||||
Statement::Vacuum(v) => {
|
||||
assert_eq!(
|
||||
v.table_name,
|
||||
Some(ObjectName::from(vec![Ident::new("tbl"),]))
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
let stmt = redshift().verified_stmt(
|
||||
"VACUUM FULL SORT ONLY DELETE ONLY REINDEX RECLUSTER db1.sc1.tbl1 TO 20 PERCENT BOOST",
|
||||
);
|
||||
match stmt {
|
||||
Statement::Vacuum(v) => {
|
||||
assert!(v.full);
|
||||
assert!(v.sort_only);
|
||||
assert!(v.delete_only);
|
||||
assert!(v.reindex);
|
||||
assert!(v.recluster);
|
||||
assert_eq!(
|
||||
v.table_name,
|
||||
Some(ObjectName::from(vec![
|
||||
Ident::new("db1"),
|
||||
Ident::new("sc1"),
|
||||
Ident::new("tbl1"),
|
||||
]))
|
||||
);
|
||||
assert_eq!(v.threshold, Some(number("20")));
|
||||
assert!(v.boost);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue