@@ -42,6 +42,33 @@ struct<key:string,value:string>
4242spark.sql.codegen.wholeStage true
4343
4444
45+ -- !query
46+ == Parsed Logical Plan ==
47+ 'Project [unresolvedalias('sum(distinct 'val), None)]
48+ +- 'UnresolvedRelation [explain_temp1]
49+
50+ == Analyzed Logical Plan ==
51+ sum(DISTINCT val): bigint
52+ Aggregate [sum(distinct cast(val#x as bigint)) AS sum(DISTINCT val)#x]
53+ +- SubqueryAlias spark_catalog.default.explain_temp1
54+ +- Relation[key#x,val#x] parquet
55+
56+ == Optimized Logical Plan ==
57+ Aggregate [sum(distinct cast(val#x as bigint)) AS sum(DISTINCT val)#x]
58+ +- Project [val#x]
59+ +- Relation[key#x,val#x] parquet
60+
61+ == Physical Plan ==
62+ *(3) HashAggregate(keys=[], functions=[sum(distinct cast(val#x as bigint)#x)], output=[sum(DISTINCT val)#x])
63+ +- Exchange SinglePartition, true, [id=#x]
64+ +- *(2) HashAggregate(keys=[], functions=[partial_sum(distinct cast(val#x as bigint)#x)], output=[sum#x])
65+ +- *(2) HashAggregate(keys=[cast(val#x as bigint)#x], functions=[], output=[cast(val#x as bigint)#x])
66+ +- Exchange hashpartitioning(cast(val#x as bigint)#x, 200), true, [id=#x]
67+ +- *(1) HashAggregate(keys=[cast(val#x as bigint) AS cast(val#x as bigint)#x], functions=[], output=[cast(val#x as bigint)#x])
68+ +- *(1) ColumnarToRow
69+ +- FileScan parquet default.explain_temp1[val#x] Batched: true, DataFilters: [], Format: Parquet, Location: InMemoryFileIndex[[not included in comparison]/{warehouse_dir}/explain_temp1], PartitionFilters: [], PushedFilters: [], ReadSchema: struct<val:int>
70+
71+
4572-- !query
4673EXPLAIN FORMATTED
4774 SELECT key, max(val)
0 commit comments