Add support for VACUUM in Redshift

This commit is contained in:
Yoav Cohen 2025-08-19 17:41:11 +03:00
parent cb7a51e85f
commit 41af5d4f6e
5 changed files with 116 additions and 0 deletions

View file

@ -407,3 +407,31 @@ fn parse_string_literal_backslash_escape() {
fn parse_utf8_multibyte_idents() {
redshift().verified_stmt("SELECT 🚀.city AS 🎸 FROM customers AS 🚀");
}
#[test]
fn parse_vacuum() {
redshift().verified_stmt("VACUUM db1.sc1.tbl1");
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!(),
}
}