dilipbiswal commented on a change in pull request #24759: [SPARK-27395][SQL] 
Improve EXPLAIN command
URL: https://github.com/apache/spark/pull/24759#discussion_r316487951
 
 

 ##########
 File path: sql/core/src/test/resources/sql-tests/inputs/explain.sql
 ##########
 @@ -0,0 +1,97 @@
+-- Test tables
+CREATE table  explain_temp1 (key int, val int) USING PARQUET;
+CREATE table  explain_temp2 (key int, val int) USING PARQUET;
+CREATE table  explain_temp3 (key int, val int) USING PARQUET;
+
+-- Simple explain
+SET spark.sql.codegen.wholeStage = true;
+
+-- single table
+EXPLAIN FORMATTED
+  SELECT key, max(val) 
+  FROM   explain_temp1 
+  WHERE  key > 0 
+  GROUP  BY key 
+  ORDER  BY key; 
+
+EXPLAIN FORMATTED
+  SELECT key, max(val)
+  FROM explain_temp1
+  WHERE key > 0
+  GROUP BY key
+  HAVING max(val) > 0;
+
+-- simple union
+EXPLAIN FORMATTED
+  SELECT key, val FROM explain_temp1 WHERE key > 0
+  UNION 
+  SELECT key, val FROM explain_temp1 WHERE key > 0;
+
+-- Join
+EXPLAIN FORMATTED
+  SELECT * 
+  FROM   explain_temp1 a, 
+         explain_temp2 b 
+  WHERE  a.key = b.key; 
+
+EXPLAIN FORMATTED
+  SELECT * 
+  FROM   explain_temp1 a 
+         INNER JOIN explain_temp2 b 
 
 Review comment:
   @cloud-fan you are right.. I will remove this case.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to