diff options
author | Cheng Lian <lian.cs.zju@gmail.com> | 2014-09-08 19:08:05 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-09-08 19:08:05 -0700 |
commit | dc1dbf206e0076a43ad2120d8bb5b1fc6912fe25 (patch) | |
tree | d9a2e0e5bd1f5512e4837dc5cee854534f7694a7 /sql/core | |
parent | ca0348e68213c2c7589f2018ebf9d889c0ce59c3 (diff) | |
download | spark-dc1dbf206e0076a43ad2120d8bb5b1fc6912fe25.tar.gz spark-dc1dbf206e0076a43ad2120d8bb5b1fc6912fe25.tar.bz2 spark-dc1dbf206e0076a43ad2120d8bb5b1fc6912fe25.zip |
[SPARK-3414][SQL] Stores analyzed logical plan when registering a temp table
Case insensitivity breaks when unresolved relation contains attributes with uppercase letters in their names, because we store unanalyzed logical plan when registering temp tables while the `CaseInsensitivityAttributeReferences` batch runs before the `Resolution` batch. To fix this issue, we need to store analyzed logical plan.
Author: Cheng Lian <lian.cs.zju@gmail.com>
Closes #2293 from liancheng/spark-3414 and squashes the following commits:
d9fa1d6 [Cheng Lian] Stores analyzed logical plan when registering a temp table
Diffstat (limited to 'sql/core')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala b/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala index 5acb45c155..a2f334aab9 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala @@ -246,7 +246,7 @@ class SQLContext(@transient val sparkContext: SparkContext) * @group userf */ def registerRDDAsTable(rdd: SchemaRDD, tableName: String): Unit = { - catalog.registerTable(None, tableName, rdd.logicalPlan) + catalog.registerTable(None, tableName, rdd.queryExecution.analyzed) } /** @@ -411,7 +411,7 @@ class SQLContext(@transient val sparkContext: SparkContext) protected def stringOrError[A](f: => A): String = try f.toString catch { case e: Throwable => e.toString } - def simpleString: String = + def simpleString: String = s"""== Physical Plan == |${stringOrError(executedPlan)} """ |