Skip to content

Commit 5095fff

Browse files
committed
update plan golden files
1 parent 9364c42 commit 5095fff

File tree

14 files changed

+1073
-2366
lines changed

14 files changed

+1073
-2366
lines changed

sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt

Lines changed: 139 additions & 184 deletions
Large diffs are not rendered by default.

sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -188,22 +188,6 @@ TakeOrderedAndProject [c_last_name,c_first_name,sales]
188188
InputAdapter
189189
ReusedExchange [c_customer_sk,sum,isEmpty] #8
190190
InputAdapter
191-
BroadcastExchange #19
192-
WholeStageCodegen (33)
193-
SortMergeJoin [c_customer_sk,c_customer_sk]
194-
InputAdapter
195-
WholeStageCodegen (29)
196-
Sort [c_customer_sk]
197-
InputAdapter
198-
ReusedExchange [c_customer_sk,c_first_name,c_last_name] #15
199-
InputAdapter
200-
WholeStageCodegen (32)
201-
Sort [c_customer_sk]
202-
Project [c_customer_sk]
203-
Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))]
204-
ReusedSubquery [tpcds_cmax] #3
205-
HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty]
206-
InputAdapter
207-
ReusedExchange [c_customer_sk,sum,isEmpty] #8
191+
ReusedExchange [c_customer_sk,c_first_name,c_last_name] #19
208192
InputAdapter
209193
ReusedExchange [d_date_sk] #3
Lines changed: 103 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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))
10197
Output [2]: [item_sk#11, rnk#17]
10298
Input [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]
147124
Left keys [1]: [rnk#17]
148-
Right keys [1]: [rnk#27]
125+
Right keys [1]: [rnk#20]
149126
Join 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]
157134
Batched: true
158135
Location [not included in comparison]/{warehouse_dir}/item]
159136
PushedFilters: [IsNotNull(i_item_sk)]
160137
ReadSchema: 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]
174151
Left keys [1]: [item_sk#11]
175-
Right keys [1]: [i_item_sk#29]
152+
Right keys [1]: [i_item_sk#22]
176153
Join 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]
188165
Join 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

200177
Subquery: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]
212189
Batched: true
213190
Location [not included in comparison]/{warehouse_dir}/store_sales]
214191
PushedFilters: [IsNotNull(ss_store_sk), EqualTo(ss_store_sk,4), IsNull(ss_addr_sk)]
215192
ReadSchema: 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

sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44.sf100/simplified.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,13 @@ TakeOrderedAndProject [rnk,best_performing,worst_performing]
4949
WholeStageCodegen (6)
5050
Sort [rank_col]
5151
InputAdapter
52-
Exchange #5
53-
WholeStageCodegen (5)
54-
Project [item_sk,rank_col]
55-
Filter [avg(ss_net_profit)]
56-
ReusedSubquery [rank_col] #1
57-
HashAggregate [ss_item_sk,sum,count] [avg(UnscaledValue(ss_net_profit)),item_sk,rank_col,avg(ss_net_profit),sum,count]
58-
InputAdapter
59-
ReusedExchange [ss_item_sk,sum,count] #2
52+
ReusedExchange [item_sk,rank_col] #1
6053
InputAdapter
61-
BroadcastExchange #6
54+
BroadcastExchange #5
6255
WholeStageCodegen (8)
6356
Filter [i_item_sk]
6457
ColumnarToRow
6558
InputAdapter
6659
Scan parquet default.item [i_item_sk,i_product_name]
6760
InputAdapter
68-
ReusedExchange [i_item_sk,i_product_name] #6
61+
ReusedExchange [i_item_sk,i_product_name] #5

0 commit comments

Comments
 (0)