aboutsummaryrefslogtreecommitdiff
path: root/sql/hive
diff options
context:
space:
mode:
authorravipesala <ravindra.pesala@huawei.com>2014-12-18 20:19:10 -0800
committerMichael Armbrust <michael@databricks.com>2014-12-18 20:19:10 -0800
commit7687415c2578b5bdc79c9646c246e52da9a4dd4a (patch)
treeb3223db3b78f0e7f10feb551fff346145bf8da47 /sql/hive
parente7de7e5f46821e1ba3b070b21d6bcf6d5ec8a796 (diff)
downloadspark-7687415c2578b5bdc79c9646c246e52da9a4dd4a.tar.gz
spark-7687415c2578b5bdc79c9646c246e52da9a4dd4a.tar.bz2
spark-7687415c2578b5bdc79c9646c246e52da9a4dd4a.zip
[SPARK-2554][SQL] Supporting SumDistinct partial aggregation
Adding support to the partial aggregation of SumDistinct Author: ravipesala <ravindra.pesala@huawei.com> Closes #3348 from ravipesala/SPARK-2554 and squashes the following commits: fd28e4d [ravipesala] Fixed review comments e60e67f [ravipesala] Fixed test cases and made it as nullable 32fe234 [ravipesala] Supporting SumDistinct partial aggregation Conflicts: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregates.scala
Diffstat (limited to 'sql/hive')
-rw-r--r--sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala13
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
index 96f3430207..f57f31af15 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
@@ -185,9 +185,14 @@ class SQLQuerySuite extends QueryTest {
sql("SELECT case when ~1=-2 then 1 else 0 end FROM src"),
sql("SELECT 1 FROM src").collect().toSeq)
}
-
- test("SPARK-4154 Query does not work if it has 'not between' in Spark SQL and HQL") {
- checkAnswer(sql("SELECT key FROM src WHERE key not between 0 and 10 order by key"),
- sql("SELECT key FROM src WHERE key between 11 and 500 order by key").collect().toSeq)
+
+ test("SPARK-4154 Query does not work if it has 'not between' in Spark SQL and HQL") {
+ checkAnswer(sql("SELECT key FROM src WHERE key not between 0 and 10 order by key"),
+ sql("SELECT key FROM src WHERE key between 11 and 500 order by key").collect().toSeq)
+ }
+
+ test("SPARK-2554 SumDistinct partial aggregation") {
+ checkAnswer(sql("SELECT sum( distinct key) FROM src group by key order by key"),
+ sql("SELECT distinct key FROM src order by key").collect().toSeq)
}
}