mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-14 15:59:03 +00:00
Support ALTER TABLE ... SET LOCATION
(#1154)
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
parent
6f090e5547
commit
991dbab755
5 changed files with 59 additions and 7 deletions
|
@ -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 => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue