Support ALTER TABLE ... SET LOCATION (#1154)

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
Jonathan Lehto 2024-03-01 14:05:05 -05:00 committed by GitHub
parent 6f090e5547
commit 991dbab755
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 59 additions and 7 deletions

View file

@ -5529,11 +5529,26 @@ impl<'a> Parser<'a> {
let only = self.parse_keyword(Keyword::ONLY); // [ ONLY ]
let table_name = self.parse_object_name(false)?;
let operations = self.parse_comma_separated(Parser::parse_alter_table_operation)?;
let mut location = None;
if self.parse_keyword(Keyword::LOCATION) {
location = Some(HiveSetLocation {
has_set: false,
location: self.parse_identifier(false)?,
});
} else if self.parse_keywords(&[Keyword::SET, Keyword::LOCATION]) {
location = Some(HiveSetLocation {
has_set: true,
location: self.parse_identifier(false)?,
});
}
Ok(Statement::AlterTable {
name: table_name,
if_exists,
only,
operations,
location,
})
}
Keyword::INDEX => {