Skip to content

Commit

Permalink
Fix off by one column indentation in SqlParser.
Browse files Browse the repository at this point in the history
  • Loading branch information
staple committed Jul 29, 2014
1 parent a7d145e commit 8566467
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,21 +210,21 @@ class SqlParser extends StandardTokenParsers with PackratParsers {
} |
"(" ~> query ~ ")" ~ opt(AS) ~ ident ^^ { case s ~ _ ~ _ ~ a => Subquery(a, s) }

protected lazy val joinedRelation: Parser[LogicalPlan] =
relationFactor ~ opt(joinType) ~ JOIN ~ relationFactor ~ opt(joinConditions) ^^ {
protected lazy val joinedRelation: Parser[LogicalPlan] =
relationFactor ~ opt(joinType) ~ JOIN ~ relationFactor ~ opt(joinConditions) ^^ {
case r1 ~ jt ~ _ ~ r2 ~ cond =>
Join(r1, r2, joinType = jt.getOrElse(Inner), cond)
}
}

protected lazy val joinConditions: Parser[Expression] =
ON ~> expression
protected lazy val joinConditions: Parser[Expression] =
ON ~> expression

protected lazy val joinType: Parser[JoinType] =
INNER ^^^ Inner |
LEFT ~ SEMI ^^^ LeftSemi |
LEFT ~ opt(OUTER) ^^^ LeftOuter |
RIGHT ~ opt(OUTER) ^^^ RightOuter |
FULL ~ opt(OUTER) ^^^ FullOuter
protected lazy val joinType: Parser[JoinType] =
INNER ^^^ Inner |
LEFT ~ SEMI ^^^ LeftSemi |
LEFT ~ opt(OUTER) ^^^ LeftOuter |
RIGHT ~ opt(OUTER) ^^^ RightOuter |
FULL ~ opt(OUTER) ^^^ FullOuter

protected lazy val filter: Parser[Expression] = WHERE ~ expression ^^ { case _ ~ e => e }

Expand Down

0 comments on commit 8566467

Please sign in to comment.