[MINOR] Clean up the joinCriteria in SQL parser
## What changes were proposed in this pull request? Clean up the joinCriteria parsing in the parser by directly using identifierList ## How was this patch tested? N/A Closes #22648 from gatorsmile/cleanupJoinCriteria. Authored-by: gatorsmile <gatorsmile@gmail.com> Signed-off-by: gatorsmile <gatorsmile@gmail.com>
This commit is contained in:
parent
7ef65c0537
commit
5a617ec4ea
|
@ -468,7 +468,7 @@ joinType
|
|||
|
||||
joinCriteria
|
||||
: ON booleanExpression
|
||||
| USING '(' identifier (',' identifier)* ')'
|
||||
| USING identifierList
|
||||
;
|
||||
|
||||
sample
|
||||
|
|
|
@ -701,7 +701,7 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging
|
|||
// Resolve the join type and join condition
|
||||
val (joinType, condition) = Option(join.joinCriteria) match {
|
||||
case Some(c) if c.USING != null =>
|
||||
(UsingJoin(baseJoinType, c.identifier.asScala.map(_.getText)), None)
|
||||
(UsingJoin(baseJoinType, visitIdentifierList(c.identifierList)), None)
|
||||
case Some(c) if c.booleanExpression != null =>
|
||||
(baseJoinType, Option(expression(c.booleanExpression)))
|
||||
case None if join.NATURAL != null =>
|
||||
|
|
Loading…
Reference in a new issue