11== Physical Plan ==
2- TakeOrderedAndProject (36 )
3- +- * Project (35 )
4- +- * BroadcastHashJoin Inner BuildRight (34 )
5- :- * Project (32 )
6- : +- * BroadcastHashJoin Inner BuildRight (31 )
7- : :- * Project (26 )
8- : : +- * BroadcastHashJoin Inner BuildRight (25 )
2+ TakeOrderedAndProject (32 )
3+ +- * Project (31 )
4+ +- * BroadcastHashJoin Inner BuildRight (30 )
5+ :- * Project (28 )
6+ : +- * BroadcastHashJoin Inner BuildRight (27 )
7+ : :- * Project (22 )
8+ : : +- * BroadcastHashJoin Inner BuildRight (21 )
99 : : :- * Project (14)
1010 : : : +- * Filter (13)
1111 : : : +- Window (12)
@@ -20,21 +20,17 @@ TakeOrderedAndProject (36)
2020 : : : +- * Filter (3)
2121 : : : +- * ColumnarToRow (2)
2222 : : : +- Scan parquet default.store_sales (1)
23- : : +- BroadcastExchange (24)
24- : : +- * Project (23)
25- : : +- * Filter (22)
26- : : +- Window (21)
27- : : +- * Sort (20)
28- : : +- Exchange (19)
29- : : +- * Project (18)
30- : : +- * Filter (17)
31- : : +- * HashAggregate (16)
32- : : +- ReusedExchange (15)
33- : +- BroadcastExchange (30)
34- : +- * Filter (29)
35- : +- * ColumnarToRow (28)
36- : +- Scan parquet default.item (27)
37- +- ReusedExchange (33)
23+ : : +- BroadcastExchange (20)
24+ : : +- * Project (19)
25+ : : +- * Filter (18)
26+ : : +- Window (17)
27+ : : +- * Sort (16)
28+ : : +- ReusedExchange (15)
29+ : +- BroadcastExchange (26)
30+ : +- * Filter (25)
31+ : +- * ColumnarToRow (24)
32+ : +- Scan parquet default.item (23)
33+ +- ReusedExchange (29)
3834
3935
4036(1) Scan parquet default.store_sales
@@ -101,148 +97,127 @@ Condition : ((rnk#17 < 11) AND isnotnull(item_sk#11))
10197Output [2]: [item_sk#11, rnk#17]
10298Input [3]: [item_sk#11, rank_col#12, rnk#17]
10399
104- (15) ReusedExchange [Reuses operator id: 6 ]
105- Output [3 ]: [ss_item_sk #18, sum #19, count#20 ]
100+ (15) ReusedExchange [Reuses operator id: 10 ]
101+ Output [2 ]: [item_sk #18, rank_col #19]
106102
107- (16) HashAggregate [codegen id : 5]
108- Input [3]: [ss_item_sk#18, sum#19, count#20]
109- Keys [1]: [ss_item_sk#18]
110- Functions [1]: [avg(UnscaledValue(ss_net_profit#21))]
111- Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_profit#21))#22]
112- Results [3]: [ss_item_sk#18 AS item_sk#23, cast((avg(UnscaledValue(ss_net_profit#21))#22 / 100.0) as decimal(11,6)) AS rank_col#24, cast((avg(UnscaledValue(ss_net_profit#21))#22 / 100.0) as decimal(11,6)) AS avg(ss_net_profit#21)#25]
103+ (16) Sort [codegen id : 6]
104+ Input [2]: [item_sk#18, rank_col#19]
105+ Arguments: [rank_col#19 DESC NULLS LAST], false, 0
113106
114- (17) Filter [codegen id : 5]
115- Input [3 ]: [item_sk#23 , rank_col#24, avg(ss_net_profit#21)#25 ]
116- Condition : (isnotnull(avg(ss_net_profit#21)#25) AND (cast(avg(ss_net_profit#21)#25 as decimal(13,7)) > CheckOverflow((0.900000 * promote_precision(ReusedSubquery Subquery scalar-subquery#14 , [id=#15])), DecimalType(13,7), true)))
107+ (17) Window
108+ Input [2 ]: [item_sk#18 , rank_col#19 ]
109+ Arguments: [rank(rank_col#19) windowspecdefinition(rank_col#19 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rnk#20] , [rank_col#19 DESC NULLS LAST]
117110
118- (18) Project [codegen id : 5 ]
119- Output [2 ]: [item_sk#23 , rank_col#24 ]
120- Input [3]: [item_sk#23, rank_col#24, avg(ss_net_profit#21)#25]
111+ (18) Filter [codegen id : 7 ]
112+ Input [3 ]: [item_sk#18 , rank_col#19, rnk#20 ]
113+ Condition : ((rnk#20 < 11) AND isnotnull(item_sk#18))
121114
122- (19) Exchange
123- Input [2]: [item_sk#23, rank_col#24 ]
124- Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#26 ]
115+ (19) Project [codegen id : 7]
116+ Output [2]: [item_sk#18, rnk#20 ]
117+ Input [3]: [item_sk#18, rank_col#19, rnk#20 ]
125118
126- (20) Sort [codegen id : 6]
127- Input [2]: [item_sk#23, rank_col#24 ]
128- Arguments: [rank_col#24 DESC NULLS LAST], false, 0
119+ (20) BroadcastExchange
120+ Input [2]: [item_sk#18, rnk#20 ]
121+ Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)), false), [id=#21]
129122
130- (21) Window
131- Input [2]: [item_sk#23, rank_col#24]
132- Arguments: [rank(rank_col#24) windowspecdefinition(rank_col#24 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rnk#27], [rank_col#24 DESC NULLS LAST]
133-
134- (22) Filter [codegen id : 7]
135- Input [3]: [item_sk#23, rank_col#24, rnk#27]
136- Condition : ((rnk#27 < 11) AND isnotnull(item_sk#23))
137-
138- (23) Project [codegen id : 7]
139- Output [2]: [item_sk#23, rnk#27]
140- Input [3]: [item_sk#23, rank_col#24, rnk#27]
141-
142- (24) BroadcastExchange
143- Input [2]: [item_sk#23, rnk#27]
144- Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#28]
145-
146- (25) BroadcastHashJoin [codegen id : 10]
123+ (21) BroadcastHashJoin [codegen id : 10]
147124Left keys [1]: [rnk#17]
148- Right keys [1]: [rnk#27 ]
125+ Right keys [1]: [rnk#20 ]
149126Join condition: None
150127
151- (26 ) Project [codegen id : 10]
152- Output [3]: [item_sk#11, rnk#17, item_sk#23 ]
153- Input [4]: [item_sk#11, rnk#17, item_sk#23 , rnk#27 ]
128+ (22 ) Project [codegen id : 10]
129+ Output [3]: [item_sk#11, rnk#17, item_sk#18 ]
130+ Input [4]: [item_sk#11, rnk#17, item_sk#18 , rnk#20 ]
154131
155- (27 ) Scan parquet default.item
156- Output [2]: [i_item_sk#29 , i_product_name#30 ]
132+ (23 ) Scan parquet default.item
133+ Output [2]: [i_item_sk#22 , i_product_name#23 ]
157134Batched: true
158135Location [not included in comparison]/{warehouse_dir}/item]
159136PushedFilters: [IsNotNull(i_item_sk)]
160137ReadSchema: struct<i_item_sk:int,i_product_name:string>
161138
162- (28 ) ColumnarToRow [codegen id : 8]
163- Input [2]: [i_item_sk#29 , i_product_name#30 ]
139+ (24 ) ColumnarToRow [codegen id : 8]
140+ Input [2]: [i_item_sk#22 , i_product_name#23 ]
164141
165- (29 ) Filter [codegen id : 8]
166- Input [2]: [i_item_sk#29 , i_product_name#30 ]
167- Condition : isnotnull(i_item_sk#29 )
142+ (25 ) Filter [codegen id : 8]
143+ Input [2]: [i_item_sk#22 , i_product_name#23 ]
144+ Condition : isnotnull(i_item_sk#22 )
168145
169- (30 ) BroadcastExchange
170- Input [2]: [i_item_sk#29 , i_product_name#30 ]
171- Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31 ]
146+ (26 ) BroadcastExchange
147+ Input [2]: [i_item_sk#22 , i_product_name#23 ]
148+ Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24 ]
172149
173- (31 ) BroadcastHashJoin [codegen id : 10]
150+ (27 ) BroadcastHashJoin [codegen id : 10]
174151Left keys [1]: [item_sk#11]
175- Right keys [1]: [i_item_sk#29 ]
152+ Right keys [1]: [i_item_sk#22 ]
176153Join condition: None
177154
178- (32 ) Project [codegen id : 10]
179- Output [3]: [rnk#17, item_sk#23 , i_product_name#30 ]
180- Input [5]: [item_sk#11, rnk#17, item_sk#23 , i_item_sk#29 , i_product_name#30 ]
155+ (28 ) Project [codegen id : 10]
156+ Output [3]: [rnk#17, item_sk#18 , i_product_name#23 ]
157+ Input [5]: [item_sk#11, rnk#17, item_sk#18 , i_item_sk#22 , i_product_name#23 ]
181158
182- (33 ) ReusedExchange [Reuses operator id: 30 ]
183- Output [2]: [i_item_sk#32 , i_product_name#33 ]
159+ (29 ) ReusedExchange [Reuses operator id: 26 ]
160+ Output [2]: [i_item_sk#25 , i_product_name#26 ]
184161
185- (34 ) BroadcastHashJoin [codegen id : 10]
186- Left keys [1]: [item_sk#23 ]
187- Right keys [1]: [i_item_sk#32 ]
162+ (30 ) BroadcastHashJoin [codegen id : 10]
163+ Left keys [1]: [item_sk#18 ]
164+ Right keys [1]: [i_item_sk#25 ]
188165Join condition: None
189166
190- (35 ) Project [codegen id : 10]
191- Output [3]: [rnk#17, i_product_name#30 AS best_performing#34 , i_product_name#33 AS worst_performing#35 ]
192- Input [5]: [rnk#17, item_sk#23 , i_product_name#30 , i_item_sk#32 , i_product_name#33 ]
167+ (31 ) Project [codegen id : 10]
168+ Output [3]: [rnk#17, i_product_name#23 AS best_performing#27 , i_product_name#26 AS worst_performing#28 ]
169+ Input [5]: [rnk#17, item_sk#18 , i_product_name#23 , i_item_sk#25 , i_product_name#26 ]
193170
194- (36 ) TakeOrderedAndProject
195- Input [3]: [rnk#17, best_performing#34 , worst_performing#35 ]
196- Arguments: 100, [rnk#17 ASC NULLS FIRST], [rnk#17, best_performing#34 , worst_performing#35 ]
171+ (32 ) TakeOrderedAndProject
172+ Input [3]: [rnk#17, best_performing#27 , worst_performing#28 ]
173+ Arguments: 100, [rnk#17 ASC NULLS FIRST], [rnk#17, best_performing#27 , worst_performing#28 ]
197174
198175===== Subqueries =====
199176
200177Subquery:1 Hosting operator id = 8 Hosting Expression = Subquery scalar-subquery#14, [id=#15]
201- * HashAggregate (43 )
202- +- Exchange (42 )
203- +- * HashAggregate (41 )
204- +- * Project (40 )
205- +- * Filter (39 )
206- +- * ColumnarToRow (38 )
207- +- Scan parquet default.store_sales (37 )
178+ * HashAggregate (39 )
179+ +- Exchange (38 )
180+ +- * HashAggregate (37 )
181+ +- * Project (36 )
182+ +- * Filter (35 )
183+ +- * ColumnarToRow (34 )
184+ +- Scan parquet default.store_sales (33 )
208185
209186
210- (37 ) Scan parquet default.store_sales
211- Output [4]: [ss_addr_sk#36 , ss_store_sk#37 , ss_net_profit#38 , ss_sold_date_sk#39 ]
187+ (33 ) Scan parquet default.store_sales
188+ Output [4]: [ss_addr_sk#29 , ss_store_sk#30 , ss_net_profit#31 , ss_sold_date_sk#32 ]
212189Batched: true
213190Location [not included in comparison]/{warehouse_dir}/store_sales]
214191PushedFilters: [IsNotNull(ss_store_sk), EqualTo(ss_store_sk,4), IsNull(ss_addr_sk)]
215192ReadSchema: struct<ss_addr_sk:int,ss_store_sk:int,ss_net_profit:decimal(7,2)>
216193
217- (38) ColumnarToRow [codegen id : 1]
218- Input [4]: [ss_addr_sk#36, ss_store_sk#37, ss_net_profit#38, ss_sold_date_sk#39]
219-
220- (39) Filter [codegen id : 1]
221- Input [4]: [ss_addr_sk#36, ss_store_sk#37, ss_net_profit#38, ss_sold_date_sk#39]
222- Condition : ((isnotnull(ss_store_sk#37) AND (ss_store_sk#37 = 4)) AND isnull(ss_addr_sk#36))
223-
224- (40) Project [codegen id : 1]
225- Output [2]: [ss_store_sk#37, ss_net_profit#38]
226- Input [4]: [ss_addr_sk#36, ss_store_sk#37, ss_net_profit#38, ss_sold_date_sk#39]
227-
228- (41) HashAggregate [codegen id : 1]
229- Input [2]: [ss_store_sk#37, ss_net_profit#38]
230- Keys [1]: [ss_store_sk#37]
231- Functions [1]: [partial_avg(UnscaledValue(ss_net_profit#38))]
232- Aggregate Attributes [2]: [sum#40, count#41]
233- Results [3]: [ss_store_sk#37, sum#42, count#43]
234-
235- (42) Exchange
236- Input [3]: [ss_store_sk#37, sum#42, count#43]
237- Arguments: hashpartitioning(ss_store_sk#37, 5), ENSURE_REQUIREMENTS, [id=#44]
238-
239- (43) HashAggregate [codegen id : 2]
240- Input [3]: [ss_store_sk#37, sum#42, count#43]
241- Keys [1]: [ss_store_sk#37]
242- Functions [1]: [avg(UnscaledValue(ss_net_profit#38))]
243- Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_profit#38))#45]
244- Results [1]: [cast((avg(UnscaledValue(ss_net_profit#38))#45 / 100.0) as decimal(11,6)) AS rank_col#46]
245-
246- Subquery:2 Hosting operator id = 17 Hosting Expression = ReusedSubquery Subquery scalar-subquery#14, [id=#15]
194+ (34) ColumnarToRow [codegen id : 1]
195+ Input [4]: [ss_addr_sk#29, ss_store_sk#30, ss_net_profit#31, ss_sold_date_sk#32]
196+
197+ (35) Filter [codegen id : 1]
198+ Input [4]: [ss_addr_sk#29, ss_store_sk#30, ss_net_profit#31, ss_sold_date_sk#32]
199+ Condition : ((isnotnull(ss_store_sk#30) AND (ss_store_sk#30 = 4)) AND isnull(ss_addr_sk#29))
200+
201+ (36) Project [codegen id : 1]
202+ Output [2]: [ss_store_sk#30, ss_net_profit#31]
203+ Input [4]: [ss_addr_sk#29, ss_store_sk#30, ss_net_profit#31, ss_sold_date_sk#32]
204+
205+ (37) HashAggregate [codegen id : 1]
206+ Input [2]: [ss_store_sk#30, ss_net_profit#31]
207+ Keys [1]: [ss_store_sk#30]
208+ Functions [1]: [partial_avg(UnscaledValue(ss_net_profit#31))]
209+ Aggregate Attributes [2]: [sum#33, count#34]
210+ Results [3]: [ss_store_sk#30, sum#35, count#36]
211+
212+ (38) Exchange
213+ Input [3]: [ss_store_sk#30, sum#35, count#36]
214+ Arguments: hashpartitioning(ss_store_sk#30, 5), ENSURE_REQUIREMENTS, [id=#37]
215+
216+ (39) HashAggregate [codegen id : 2]
217+ Input [3]: [ss_store_sk#30, sum#35, count#36]
218+ Keys [1]: [ss_store_sk#30]
219+ Functions [1]: [avg(UnscaledValue(ss_net_profit#31))]
220+ Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_profit#31))#38]
221+ Results [1]: [cast((avg(UnscaledValue(ss_net_profit#31))#38 / 100.0) as decimal(11,6)) AS rank_col#39]
247222
248223
0 commit comments