mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-03 04:37:21 +00:00
Fix AS query clause should be after the create table options (#1339)
This commit is contained in:
parent
993216f3ac
commit
20f7ac59e3
4 changed files with 61 additions and 10 deletions
|
@ -5418,13 +5418,6 @@ impl<'a> Parser<'a> {
|
|||
|
||||
let create_table_config = self.parse_optional_create_table_config()?;
|
||||
|
||||
// Parse optional `AS ( query )`
|
||||
let query = if self.parse_keyword(Keyword::AS) {
|
||||
Some(self.parse_boxed_query()?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let default_charset = if self.parse_keywords(&[Keyword::DEFAULT, Keyword::CHARSET]) {
|
||||
self.expect_token(&Token::Eq)?;
|
||||
let next_token = self.next_token();
|
||||
|
@ -5477,6 +5470,13 @@ impl<'a> Parser<'a> {
|
|||
None
|
||||
};
|
||||
|
||||
// Parse optional `AS ( query )`
|
||||
let query = if self.parse_keyword(Keyword::AS) {
|
||||
Some(self.parse_boxed_query()?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Ok(CreateTableBuilder::new(table_name)
|
||||
.temporary(temporary)
|
||||
.columns(columns)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue