mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 19:27:21 +00:00
Add support for VACUUM in Redshift
This commit is contained in:
parent
cb7a51e85f
commit
41af5d4f6e
5 changed files with 116 additions and 0 deletions
|
@ -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!(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue