mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-19 13:40:15 +00:00
Parse merge source as table factor (#483)
* Parse source of MERGE as table_factor Some MERGE queries need a table as a soruce, added proper test showing it * Clippy fix Co-authored-by: Maciej Skrzypkowski <maciej.skrzypkowski@satoricyber.com>
This commit is contained in:
parent
35f5f0be4d
commit
9750841a66
3 changed files with 58 additions and 55 deletions
|
@ -4288,8 +4288,7 @@ impl<'a> Parser<'a> {
|
|||
let table = self.parse_table_factor()?;
|
||||
|
||||
self.expect_keyword(Keyword::USING)?;
|
||||
let source = self.parse_query_body(0)?;
|
||||
let alias = self.parse_optional_table_alias(keywords::RESERVED_FOR_TABLE_ALIAS)?;
|
||||
let source = self.parse_table_factor()?;
|
||||
self.expect_keyword(Keyword::ON)?;
|
||||
let on = self.parse_expr()?;
|
||||
let clauses = self.parse_merge_clauses()?;
|
||||
|
@ -4297,8 +4296,7 @@ impl<'a> Parser<'a> {
|
|||
Ok(Statement::Merge {
|
||||
into,
|
||||
table,
|
||||
source: Box::new(source),
|
||||
alias,
|
||||
source,
|
||||
on: Box::new(on),
|
||||
clauses,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue