diff options
author | ravipesala <ravindra.pesala@huawei.com> | 2014-11-20 15:34:03 -0800 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-11-20 15:34:03 -0800 |
commit | 98e9419784a9ad5096cfd563fa9a433786a90bd4 (patch) | |
tree | 94c3c12c8b629355c6f5e73bada18f172ca6adeb /sql/core/src | |
parent | 1c53a5db993193122bfa79574d2540149fe2cc08 (diff) | |
download | spark-98e9419784a9ad5096cfd563fa9a433786a90bd4.tar.gz spark-98e9419784a9ad5096cfd563fa9a433786a90bd4.tar.bz2 spark-98e9419784a9ad5096cfd563fa9a433786a90bd4.zip |
[SPARK-4513][SQL] Support relational operator '<=>' in Spark SQL
The relational operator '<=>' is not working in Spark SQL. Same works in Spark HiveQL
Author: ravipesala <ravindra.pesala@huawei.com>
Closes #3387 from ravipesala/<=> and squashes the following commits:
7198e90 [ravipesala] Supporting relational operator '<=>' in Spark SQL
Diffstat (limited to 'sql/core/src')
-rw-r--r-- | sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala index a63515464c..0a96831c76 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala @@ -973,4 +973,16 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll { checkAnswer(sql("SELECT a.b + 1 FROM data GROUP BY a.b + 1"), 2) dropTempTable("data") } + + test("Supporting relational operator '<=>' in Spark SQL") { + val nullCheckData1 = TestData(1,"1") :: TestData(2,null) :: Nil + val rdd1 = sparkContext.parallelize((0 to 1).map(i => nullCheckData1(i))) + rdd1.registerTempTable("nulldata1") + val nullCheckData2 = TestData(1,"1") :: TestData(2,null) :: Nil + val rdd2 = sparkContext.parallelize((0 to 1).map(i => nullCheckData2(i))) + rdd2.registerTempTable("nulldata2") + checkAnswer(sql("SELECT nulldata1.key FROM nulldata1 join " + + "nulldata2 on nulldata1.value <=> nulldata2.value"), + (1 to 2).map(i => Seq(i))) + } } |