Skip to content

Commit

Permalink
Add test for HAVING without GROUP BY
Browse files Browse the repository at this point in the history
  • Loading branch information
willb committed Jun 20, 2014
1 parent b880bef commit 18387f1
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class HiveQuerySuite extends HiveComparisonTest {
TestHive.reset()
}

test("SPARK-2180: HAVING support in GROUP BY clauses") {
test("SPARK-2180: HAVING support in GROUP BY clauses (positive)") {
val fixture = List(("foo", 2), ("bar", 1), ("foo", 4), ("bar", 3))
.zipWithIndex.map {case Pair(Pair(value, attr), key) => HavingRow(key, value, attr)}

Expand All @@ -239,6 +239,12 @@ class HiveQuerySuite extends HiveComparisonTest {
TestHive.reset()
}

test("SPARK-2180: HAVING without GROUP BY raises exception") {
intercept[Exception] {
hql("SELECT value, attr FROM having_test HAVING attr > 3")
}
}

test("Query Hive native command execution result") {
val tableName = "test_native_commands"

Expand Down

0 comments on commit 18387f1

Please sign in to comment.