Skip to content

Add support for VACUUM in Redshift#2005

Merged
iffyio merged 2 commits intoapache:mainfrom
yoavcloud:redshift_vacuum
Aug 21, 2025
Merged

Add support for VACUUM in Redshift#2005
iffyio merged 2 commits intoapache:mainfrom
yoavcloud:redshift_vacuum

Conversation

@yoavcloud
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/ast/mod.rs
Comment on lines +10610 to +10619
/// '''sql
/// VACUUM [ FULL | SORT ONLY | DELETE ONLY | REINDEX | RECLUSTER ] [ \[ table_name \] [ TO threshold PERCENT ] \[ BOOST \] ]
/// '''
Copy link
Copy Markdown
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 \] ]
/// ```

Comment thread src/parser/mod.rs Outdated
self.prev_token();
self.parse_export_data()
}
Keyword::VACUUM => self.parse_vacuum(),
Copy link
Copy Markdown
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

Comment thread src/parser/mod.rs Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
ayman-sigma pushed a commit to sigmacomputing/sqlparser-rs that referenced this pull request Feb 3, 2026
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