mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-03 20:50:33 +00:00
Allow to use the GLOBAL keyword before the join operator (#1353)
This commit is contained in:
parent
bc15f7b4ce
commit
f96658006f
9 changed files with 81 additions and 8 deletions
|
@ -9015,6 +9015,7 @@ impl<'a> Parser<'a> {
|
|||
// a table alias.
|
||||
let mut joins = vec![];
|
||||
loop {
|
||||
let global = self.parse_keyword(Keyword::GLOBAL);
|
||||
let join = if self.parse_keyword(Keyword::CROSS) {
|
||||
let join_operator = if self.parse_keyword(Keyword::JOIN) {
|
||||
JoinOperator::CrossJoin
|
||||
|
@ -9026,6 +9027,7 @@ impl<'a> Parser<'a> {
|
|||
};
|
||||
Join {
|
||||
relation: self.parse_table_factor()?,
|
||||
global,
|
||||
join_operator,
|
||||
}
|
||||
} else if self.parse_keyword(Keyword::OUTER) {
|
||||
|
@ -9033,6 +9035,7 @@ impl<'a> Parser<'a> {
|
|||
self.expect_keyword(Keyword::APPLY)?;
|
||||
Join {
|
||||
relation: self.parse_table_factor()?,
|
||||
global,
|
||||
join_operator: JoinOperator::OuterApply,
|
||||
}
|
||||
} else if self.parse_keyword(Keyword::ASOF) {
|
||||
|
@ -9042,6 +9045,7 @@ impl<'a> Parser<'a> {
|
|||
let match_condition = self.parse_parenthesized(Self::parse_expr)?;
|
||||
Join {
|
||||
relation,
|
||||
global,
|
||||
join_operator: JoinOperator::AsOf {
|
||||
match_condition,
|
||||
constraint: self.parse_join_constraint(false)?,
|
||||
|
@ -9127,6 +9131,7 @@ impl<'a> Parser<'a> {
|
|||
let join_constraint = self.parse_join_constraint(natural)?;
|
||||
Join {
|
||||
relation,
|
||||
global,
|
||||
join_operator: join_operator_type(join_constraint),
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue