mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-19 05:30:19 +00:00
add SELECT INTO statement variation (#447)
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
This commit is contained in:
parent
b68e9a3801
commit
d38c30e9ff
7 changed files with 74 additions and 2 deletions
|
@ -2892,6 +2892,21 @@ impl<'a> Parser<'a> {
|
|||
|
||||
let projection = self.parse_comma_separated(Parser::parse_select_item)?;
|
||||
|
||||
let into = if self.parse_keyword(Keyword::INTO) {
|
||||
let temporary = self
|
||||
.parse_one_of_keywords(&[Keyword::TEMP, Keyword::TEMPORARY])
|
||||
.is_some();
|
||||
let unlogged = self.parse_keyword(Keyword::UNLOGGED);
|
||||
let name = self.parse_object_name()?;
|
||||
Some(SelectInto {
|
||||
temporary,
|
||||
unlogged,
|
||||
name,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
// Note that for keywords to be properly handled here, they need to be
|
||||
// added to `RESERVED_FOR_COLUMN_ALIAS` / `RESERVED_FOR_TABLE_ALIAS`,
|
||||
// otherwise they may be parsed as an alias as part of the `projection`
|
||||
|
@ -2973,6 +2988,7 @@ impl<'a> Parser<'a> {
|
|||
distinct,
|
||||
top,
|
||||
projection,
|
||||
into,
|
||||
from,
|
||||
lateral_views,
|
||||
selection,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue