iffyio commented on code in PR #2005: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2005#discussion_r2287943062
########## src/ast/mod.rs: ########## @@ -10597,6 +10605,50 @@ impl fmt::Display for InitializeKind { } } +/// Re-sorts rows and reclaims space in either a specified table or all tables in the current database +/// +/// '''sql +/// VACUUM [ FULL | SORT ONLY | DELETE ONLY | REINDEX | RECLUSTER ] [ \[ table_name \] [ TO threshold PERCENT ] \[ BOOST \] ] +/// ''' Review Comment: ```suggestion /// ```sql /// VACUUM [ FULL | SORT ONLY | DELETE ONLY | REINDEX | RECLUSTER ] [ \[ table_name \] [ TO threshold PERCENT ] \[ BOOST \] ] /// ``` ``` ########## src/parser/mod.rs: ########## @@ -649,6 +649,7 @@ impl<'a> Parser<'a> { self.prev_token(); self.parse_export_data() } + Keyword::VACUUM => self.parse_vacuum(), Review Comment: ```suggestion 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 ########## src/parser/mod.rs: ########## @@ -16874,6 +16875,38 @@ impl<'a> Parser<'a> { })) } + fn parse_vacuum(&mut self) -> Result<Statement, ParserError> { + let full = self.parse_keyword(Keyword::FULL); + let sort_only = self.parse_keywords(&[Keyword::SORT, Keyword::ONLY]); + 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) { Review Comment: ```suggestion let (table_name, threshold, boost) = match self.parse_object_name(false)? { ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org