File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1818package org .apache .spark .sql .hive .execution
1919
2020import org .apache .spark .sql .hive .test .TestHive ._
21+ import org .apache .spark .sql .hive .test .TestHive
2122
2223/**
2324 * A set of test cases expressed in Hive QL that are not covered by the tests included in the hive distribution.
@@ -160,4 +161,14 @@ class HiveQuerySuite extends HiveComparisonTest {
160161 hql(" SELECT * FROM src" ).toString
161162 }
162163
164+ test(" SPARK-1704: Explain commands as a SchemaRDD" ) {
165+ hql(" CREATE TABLE IF NOT EXISTS src (key INT, value STRING)" )
166+ val rdd = hql(" explain select key, count(value) from src group by key" )
167+ assert(rdd.collect().size == 1 )
168+ assert(rdd.toString.contains(" ExplainCommand" ))
169+ assert(rdd.filter(row => row.toString.contains(" ExplainCommand" )).collect().size == 0 ,
170+ " actual contents of the result should be the plans of the query to be explained" )
171+ TestHive .reset()
172+ }
173+
163174}
You can’t perform that action at this time.
0 commit comments