[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:
gatorsmile 2018-10-06 09:15:44 -07:00
parent 7ef65c0537
commit 5a617ec4ea
2 changed files with 2 additions and 2 deletions

View file

@ -468,7 +468,7 @@ joinType
joinCriteria
: ON booleanExpression
| USING '(' identifier (',' identifier)* ')'
| USING identifierList
;
sample

View file

@ -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 =>