Github user alexliu68 commented on a diff in the pull request: https://github.com/apache/spark/pull/3941#discussion_r22755728 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/SqlParser.scala --- @@ -178,10 +178,23 @@ class SqlParser extends AbstractSparkSQLParser { joinedRelation | relationFactor protected lazy val relationFactor: Parser[LogicalPlan] = - ( ident ~ (opt(AS) ~> opt(ident)) ^^ { - case tableName ~ alias => UnresolvedRelation(None, tableName, alias) + ( + ident ~ ("." ~> ident) ~ ("." ~> ident) ~ ("." ~> ident) ~ (opt(AS) ~> opt(ident)) ^^ { + case reserveName1 ~ reserveName2 ~ dbName ~ tableName ~ alias => + UnresolvedRelation(IndexedSeq(tableName, dbName, reserveName2, reserveName1), alias) } - | ("(" ~> start <~ ")") ~ (AS.? ~> ident) ^^ { case s ~ a => Subquery(a, s) } + | ident ~ ("." ~> ident) ~ ("." ~> ident) ~ (opt(AS) ~> opt(ident)) ^^ { + case reserveName1 ~ dbName ~ tableName ~ alias => + UnresolvedRelation(IndexedSeq(tableName, dbName, reserveName1), alias) + } + | ident ~ ("." ~> ident) ~ (opt(AS) ~> opt(ident)) ^^ { + case dbName ~ tableName ~ alias => + UnresolvedRelation(IndexedSeq(tableName, dbName), alias) + } + | ident ~ (opt(AS) ~> opt(ident)) ^^ { + case tableName ~ alias => UnresolvedRelation(IndexedSeq(tableName), alias) --- End diff -- I change it to rep1sep(ident, ".")
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org