Skip to content

Commit

Permalink
Add a regression test.
Browse files Browse the repository at this point in the history
  • Loading branch information
concretevitamin committed Jun 9, 2014
1 parent 1bfa379 commit 5b7911f
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.spark.sql.hive.execution

import org.apache.spark.sql.hive.test.TestHive._
import org.apache.spark.sql.hive.test.TestHive

/**
* A set of test cases expressed in Hive QL that are not covered by the tests included in the hive distribution.
Expand Down Expand Up @@ -160,4 +161,14 @@ class HiveQuerySuite extends HiveComparisonTest {
hql("SELECT * FROM src").toString
}

test("SPARK-1704: Explain commands as a SchemaRDD") {
hql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING)")
val rdd = hql("explain select key, count(value) from src group by key")
assert(rdd.collect().size == 1)
assert(rdd.toString.contains("ExplainCommand"))
assert(rdd.filter(row => row.toString.contains("ExplainCommand")).collect().size == 0,
"actual contents of the result should be the plans of the query to be explained")
TestHive.reset()
}

}

0 comments on commit 5b7911f

Please sign in to comment.