Skip to content

Commit e90035e

Browse files
rxinliancheng
authored andcommitted
[SPARK-7886] Added unit test for HAVING aggregate pushdown.
This is a followup to apache#6712. Author: Reynold Xin <[email protected]> Closes apache#6739 from rxin/6712-followup and squashes the following commits: fd9acfb [Reynold Xin] [SPARK-7886] Added unit test for HAVING aggregate pushdown.
1 parent 57c60c5 commit e90035e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll with SQLTestUtils {
3838
import sqlContext.implicits._
3939
import sqlContext.sql
4040

41+
test("having clause") {
42+
Seq(("one", 1), ("two", 2), ("three", 3), ("one", 5)).toDF("k", "v").registerTempTable("hav")
43+
checkAnswer(
44+
sql("SELECT k, sum(v) FROM hav GROUP BY k HAVING sum(v) > 2"),
45+
Row("one", 6) :: Row("three", 3) :: Nil)
46+
}
47+
4148
test("SPARK-6743: no columns from cache") {
4249
Seq(
4350
(83, 0, 38),

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,6 @@ https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C
13071307
HiveParser.DecimalLiteral)
13081308

13091309
/* Case insensitive matches */
1310-
val COALESCE = "(?i)COALESCE".r
13111310
val COUNT = "(?i)COUNT".r
13121311
val SUM = "(?i)SUM".r
13131312
val AND = "(?i)AND".r

0 commit comments

Comments
 (0)