Skip to content

Commit

Permalink
Correctly assign aliases to tables in SqlParser.
Browse files Browse the repository at this point in the history
  • Loading branch information
marmbrus committed Apr 3, 2014
1 parent d94826b commit 01f2dd5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class SqlParser extends StandardTokenParsers {

protected lazy val relationFactor: Parser[LogicalPlan] =
ident ~ (opt(AS) ~> opt(ident)) ^^ {
case ident ~ alias => UnresolvedRelation(alias, ident)
case tableName ~ alias => UnresolvedRelation(None, tableName, alias)
} |
"(" ~> query ~ ")" ~ opt(AS) ~ ident ^^ { case s ~ _ ~ _ ~ a => Subquery(a, s) }

Expand Down

0 comments on commit 01f2dd5

Please sign in to comment.