aboutsummaryrefslogtreecommitdiff
path: root/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveExplainSuite.scala
diff options
context:
space:
mode:
Diffstat (limited to 'sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveExplainSuite.scala')
-rw-r--r--sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveExplainSuite.scala29
1 files changed, 29 insertions, 0 deletions
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveExplainSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveExplainSuite.scala
index b7ef5d1db7..c45d49d6c0 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveExplainSuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveExplainSuite.scala
@@ -101,4 +101,33 @@ class HiveExplainSuite extends QueryTest with SQLTestUtils with TestHiveSingleto
"Physical Plan should not contain Subquery since it's eliminated by optimizer")
}
}
+
+ test("EXPLAIN CODEGEN command") {
+ checkExistence(sql("EXPLAIN CODEGEN SELECT 1"), true,
+ "WholeStageCodegen",
+ "Generated code:",
+ "/* 001 */ public Object generate(Object[] references) {",
+ "/* 002 */ return new GeneratedIterator(references);",
+ "/* 003 */ }"
+ )
+
+ checkExistence(sql("EXPLAIN CODEGEN SELECT 1"), false,
+ "== Physical Plan =="
+ )
+
+ checkExistence(sql("EXPLAIN EXTENDED CODEGEN SELECT 1"), true,
+ "WholeStageCodegen",
+ "Generated code:",
+ "/* 001 */ public Object generate(Object[] references) {",
+ "/* 002 */ return new GeneratedIterator(references);",
+ "/* 003 */ }"
+ )
+
+ checkExistence(sql("EXPLAIN EXTENDED CODEGEN SELECT 1"), false,
+ "== Parsed Logical Plan ==",
+ "== Analyzed Logical Plan ==",
+ "== Optimized Logical Plan ==",
+ "== Physical Plan =="
+ )
+ }
}