Skip to content

Add support for VACUUM in Redshift #2005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 21, 2025
Merged

Conversation

yoavcloud
Copy link
Contributor

No description provided.

Comment on lines +10610 to +10619
/// '''sql
/// VACUUM [ FULL | SORT ONLY | DELETE ONLY | REINDEX | RECLUSTER ] [ \[ table_name \] [ TO threshold PERCENT ] \[ BOOST \] ]
/// '''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// '''sql
/// VACUUM [ FULL | SORT ONLY | DELETE ONLY | REINDEX | RECLUSTER ] [ \[ table_name \] [ TO threshold PERCENT ] \[ BOOST \] ]
/// '''
/// ```sql
/// VACUUM [ FULL | SORT ONLY | DELETE ONLY | REINDEX | RECLUSTER ] [ \[ table_name \] [ TO threshold PERCENT ] \[ BOOST \] ]
/// ```

@@ -649,6 +649,7 @@ impl<'a> Parser<'a> {
self.prev_token();
self.parse_export_data()
}
Keyword::VACUUM => self.parse_vacuum(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Keyword::VACUUM => self.parse_vacuum(),
Keyword::VACUUM => {
self.prev_token();
self.parse_vacuum()
}

Thinking so that we can make parse_vacuum standalone to be able to parse a full VACUUM statement

let delete_only = self.parse_keywords(&[Keyword::DELETE, Keyword::ONLY]);
let reindex = self.parse_keyword(Keyword::REINDEX);
let recluster = self.parse_keyword(Keyword::RECLUSTER);
let (table_name, threshold, boost) = match self.parse_object_name(false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let (table_name, threshold, boost) = match self.parse_object_name(false) {
let (table_name, threshold, boost) = match self.parse_object_name(false)? {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, my intention was to optionally parse an object_name. See latest commit.

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @yoavcloud!
cc @alamb

@iffyio iffyio merged commit e9eee00 into apache:main Aug 21, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants