Repository: spark
Updated Branches:
  refs/heads/master 57c60c5be -> e90035e67


[SPARK-7886] Added unit test for HAVING aggregate pushdown.

This is a followup to #6712.

Author: Reynold Xin <r...@databricks.com>

Closes #6739 from rxin/6712-followup and squashes the following commits:

fd9acfb [Reynold Xin] [SPARK-7886] Added unit test for HAVING aggregate 
pushdown.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e90035e6
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e90035e6
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e90035e6

Branch: refs/heads/master
Commit: e90035e676e492de840f44b61b330db526313019
Parents: 57c60c5
Author: Reynold Xin <r...@databricks.com>
Authored: Wed Jun 10 18:58:01 2015 +0800
Committer: Cheng Lian <l...@databricks.com>
Committed: Wed Jun 10 18:58:01 2015 +0800

----------------------------------------------------------------------
 .../src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala   | 7 +++++++
 .../src/main/scala/org/apache/spark/sql/hive/HiveQl.scala     | 1 -
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e90035e6/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
----------------------------------------------------------------------
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 5babc43..3ca5ff3 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
@@ -38,6 +38,13 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll 
with SQLTestUtils {
   import sqlContext.implicits._
   import sqlContext.sql
 
+  test("having clause") {
+    Seq(("one", 1), ("two", 2), ("three", 3), ("one", 5)).toDF("k", 
"v").registerTempTable("hav")
+    checkAnswer(
+      sql("SELECT k, sum(v) FROM hav GROUP BY k HAVING sum(v) > 2"),
+      Row("one", 6) :: Row("three", 3) :: Nil)
+  }
+
   test("SPARK-6743: no columns from cache") {
     Seq(
       (83, 0, 38),

http://git-wip-us.apache.org/repos/asf/spark/blob/e90035e6/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
----------------------------------------------------------------------
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala 
b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
index 041483e..ca4b80b 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
@@ -1307,7 +1307,6 @@ 
https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C
     HiveParser.DecimalLiteral)
 
   /* Case insensitive matches */
-  val COALESCE = "(?i)COALESCE".r
   val COUNT = "(?i)COUNT".r
   val SUM = "(?i)SUM".r
   val AND = "(?i)AND".r


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to