diff options
author | windpiger <songjun@outlook.com> | 2017-02-19 16:50:16 -0800 |
---|---|---|
committer | Xiao Li <gatorsmile@gmail.com> | 2017-02-19 16:50:16 -0800 |
commit | 65fe902e13153ad73a3026a66e73c93393df1abb (patch) | |
tree | 92f595402705f0d3b7d2c1841c6ce1a6da7593de /sql/core/src/main | |
parent | 1487c9af20a333ead55955acf4c0aa323bea0d07 (diff) | |
download | spark-65fe902e13153ad73a3026a66e73c93393df1abb.tar.gz spark-65fe902e13153ad73a3026a66e73c93393df1abb.tar.bz2 spark-65fe902e13153ad73a3026a66e73c93393df1abb.zip |
[SPARK-19598][SQL] Remove the alias parameter in UnresolvedRelation
## What changes were proposed in this pull request?
Remove the alias parameter in `UnresolvedRelation`, and use `SubqueryAlias` to replace it.
This can simplify some `match case` situations.
For example, the broadcast hint pull request can have one fewer case https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveHints.scala#L57-L61
## How was this patch tested?
add some unit tests
Author: windpiger <songjun@outlook.com>
Closes #16956 from windpiger/removeUnresolveTableAlias.
Diffstat (limited to 'sql/core/src/main')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala index 1c3e7c6d52..e7a59d4ad4 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala @@ -52,8 +52,7 @@ class ResolveSQLOnFile(sparkSession: SparkSession) extends Rule[LogicalPlan] { throw new AnalysisException("Unsupported data source type for direct query on files: " + s"${u.tableIdentifier.database.get}") } - val plan = LogicalRelation(dataSource.resolveRelation()) - u.alias.map(a => SubqueryAlias(a, plan, None)).getOrElse(plan) + LogicalRelation(dataSource.resolveRelation()) } catch { case _: ClassNotFoundException => u case e: Exception => |