Github user yjshen commented on a diff in the pull request:
https://github.com/apache/spark/pull/7986#discussion_r36584198
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveExplainSuite.scala
---
@@ -74,4 +79,30 @@ class HiveExplainSuite extends QueryTest {
"Limit",
"src")
}
+
+ test("SPARK-6212: The EXPLAIN output of CTAS only shows the analyzed
plan") {
+ withTempTable("jt") {
+ val rdd = sparkContext.parallelize((1 to 10).map(i => s"""{"a":$i,
"b":"str$i"}"""))
+ read.json(rdd).registerTempTable("jt")
+ val outputs = sql(
+ s"""
+ |EXPLAIN EXTENDED
+ |CREATE TABLE t1
+ |AS
+ |SELECT * FROM jt
+ """.stripMargin).collect().map(_.mkString).mkString
+
+ val shouldContain =
--- End diff --
EliminateSubQueries also take effect during optimiser, isn't it?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]