diff options
author | Liang-Chi Hsieh <simonh@tw.ibm.com> | 2016-08-20 23:29:48 +0800 |
---|---|---|
committer | Wenchen Fan <wenchen@databricks.com> | 2016-08-20 23:29:48 +0800 |
commit | 31a015572024046f4deaa6cec66bb6fab110f31d (patch) | |
tree | 3633ea15736e3b5afb9e51fe38330af42fae8b42 /sql/hive/src | |
parent | 3e5fdeb3fb084cc9d25ce2f3f8cbf07a0aa2c573 (diff) | |
download | spark-31a015572024046f4deaa6cec66bb6fab110f31d.tar.gz spark-31a015572024046f4deaa6cec66bb6fab110f31d.tar.bz2 spark-31a015572024046f4deaa6cec66bb6fab110f31d.zip |
[SPARK-17104][SQL] LogicalRelation.newInstance should follow the semantics of MultiInstanceRelation
## What changes were proposed in this pull request?
Currently `LogicalRelation.newInstance()` simply creates another `LogicalRelation` object with the same parameters. However, the `newInstance()` method inherited from `MultiInstanceRelation` should return a copy of object with unique expression ids. Current `LogicalRelation.newInstance()` can cause failure when doing self-join.
## How was this patch tested?
Jenkins tests.
Author: Liang-Chi Hsieh <simonh@tw.ibm.com>
Closes #14682 from viirya/fix-localrelation.
Diffstat (limited to 'sql/hive/src')
-rw-r--r-- | sql/hive/src/test/scala/org/apache/spark/sql/hive/parquetSuites.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/parquetSuites.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/parquetSuites.scala index 31b6197d56..e92bbdea75 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/parquetSuites.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/parquetSuites.scala @@ -589,6 +589,13 @@ class ParquetMetastoreSuite extends ParquetPartitioningTest { } } } + + test("self-join") { + val table = spark.table("normal_parquet") + val selfJoin = table.as("t1").join(table.as("t2")) + checkAnswer(selfJoin, + sql("SELECT * FROM normal_parquet x JOIN normal_parquet y")) + } } /** |