== Physical Plan ==
* Sort (48)
+- Exchange (47)
   +- * Filter (46)
      +- * HashAggregate (45)
         +- Exchange (44)
            +- * HashAggregate (43)
               +- * HashAggregate (42)
                  +- Exchange (41)
                     +- * HashAggregate (40)
                        +- * Project (39)
                           +- * SortMergeJoin Inner (38)
                              :- * Sort (31)
                              :  +- Exchange (30)
                              :     +- * Project (29)
                              :        +- * BroadcastHashJoin Inner BuildRight (28)
                              :           :- * Project (23)
                              :           :  +- * BroadcastHashJoin Inner BuildLeft (22)
                              :           :     :- BroadcastExchange (17)
                              :           :     :  +- * Project (16)
                              :           :     :     +- * BroadcastHashJoin Inner BuildLeft (15)
                              :           :     :        :- BroadcastExchange (11)
                              :           :     :        :  +- * Project (10)
                              :           :     :        :     +- * BroadcastHashJoin Inner BuildLeft (9)
                              :           :     :        :        :- BroadcastExchange (5)
                              :           :     :        :        :  +- * Project (4)
                              :           :     :        :        :     +- * Filter (3)
                              :           :     :        :        :        +- * ColumnarToRow (2)
                              :           :     :        :        :           +- Scan parquet spark_catalog.default.store (1)
                              :           :     :        :        +- * Filter (8)
                              :           :     :        :           +- * ColumnarToRow (7)
                              :           :     :        :              +- Scan parquet spark_catalog.default.customer_address (6)
                              :           :     :        +- * Filter (14)
                              :           :     :           +- * ColumnarToRow (13)
                              :           :     :              +- Scan parquet spark_catalog.default.customer (12)
                              :           :     +- * Project (21)
                              :           :        +- * Filter (20)
                              :           :           +- * ColumnarToRow (19)
                              :           :              +- Scan parquet spark_catalog.default.store_sales (18)
                              :           +- BroadcastExchange (27)
                              :              +- * Filter (26)
                              :                 +- * ColumnarToRow (25)
                              :                    +- Scan parquet spark_catalog.default.item (24)
                              +- * Sort (37)
                                 +- Exchange (36)
                                    +- * Project (35)
                                       +- * Filter (34)
                                          +- * ColumnarToRow (33)
                                             +- Scan parquet spark_catalog.default.store_returns (32)


(1) Scan parquet spark_catalog.default.store
Output [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store]
PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)]
ReadSchema: struct<s_store_sk:int,s_store_name:string,s_market_id:int,s_state:string,s_zip:string>

(2) ColumnarToRow [codegen id : 1]
Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5]

(3) Filter [codegen id : 1]
Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5]
Condition : (((isnotnull(s_market_id#3) AND (s_market_id#3 = 8)) AND isnotnull(s_store_sk#1)) AND isnotnull(s_zip#5))

(4) Project [codegen id : 1]
Output [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5]
Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5]

(5) BroadcastExchange
Input [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5]
Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [plan_id=1]

(6) Scan parquet spark_catalog.default.customer_address
Output [4]: [ca_address_sk#6, ca_state#7, ca_zip#8, ca_country#9]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)]
ReadSchema: struct<ca_address_sk:int,ca_state:string,ca_zip:string,ca_country:string>

(7) ColumnarToRow
Input [4]: [ca_address_sk#6, ca_state#7, ca_zip#8, ca_country#9]

(8) Filter
Input [4]: [ca_address_sk#6, ca_state#7, ca_zip#8, ca_country#9]
Condition : ((isnotnull(ca_address_sk#6) AND isnotnull(ca_country#9)) AND isnotnull(ca_zip#8))

(9) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [s_zip#5]
Right keys [1]: [ca_zip#8]
Join type: Inner
Join condition: None

(10) Project [codegen id : 2]
Output [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#6, ca_state#7, ca_country#9]
Input [8]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5, ca_address_sk#6, ca_state#7, ca_zip#8, ca_country#9]

(11) BroadcastExchange
Input [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#6, ca_state#7, ca_country#9]
Arguments: HashedRelationBroadcastMode(List(input[3, int, true], upper(input[5, string, true])),false), [plan_id=2]

(12) Scan parquet spark_catalog.default.customer
Output [5]: [c_customer_sk#10, c_current_addr_sk#11, c_first_name#12, c_last_name#13, c_birth_country#14]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_birth_country)]
ReadSchema: struct<c_customer_sk:int,c_current_addr_sk:int,c_first_name:string,c_last_name:string,c_birth_country:string>

(13) ColumnarToRow
Input [5]: [c_customer_sk#10, c_current_addr_sk#11, c_first_name#12, c_last_name#13, c_birth_country#14]

(14) Filter
Input [5]: [c_customer_sk#10, c_current_addr_sk#11, c_first_name#12, c_last_name#13, c_birth_country#14]
Condition : ((isnotnull(c_customer_sk#10) AND isnotnull(c_current_addr_sk#11)) AND isnotnull(c_birth_country#14))

(15) BroadcastHashJoin [codegen id : 3]
Left keys [2]: [ca_address_sk#6, upper(ca_country#9)]
Right keys [2]: [c_current_addr_sk#11, c_birth_country#14]
Join type: Inner
Join condition: None

(16) Project [codegen id : 3]
Output [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#7, c_customer_sk#10, c_first_name#12, c_last_name#13]
Input [11]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#6, ca_state#7, ca_country#9, c_customer_sk#10, c_current_addr_sk#11, c_first_name#12, c_last_name#13, c_birth_country#14]

(17) BroadcastExchange
Input [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#7, c_customer_sk#10, c_first_name#12, c_last_name#13]
Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [plan_id=3]

(18) Scan parquet spark_catalog.default.store_sales
Output [6]: [ss_item_sk#15, ss_customer_sk#16, ss_store_sk#17, ss_ticket_number#18, ss_net_paid#19, ss_sold_date_sk#20]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_item_sk:int,ss_customer_sk:int,ss_store_sk:int,ss_ticket_number:int,ss_net_paid:decimal(7,2)>

(19) ColumnarToRow
Input [6]: [ss_item_sk#15, ss_customer_sk#16, ss_store_sk#17, ss_ticket_number#18, ss_net_paid#19, ss_sold_date_sk#20]

(20) Filter
Input [6]: [ss_item_sk#15, ss_customer_sk#16, ss_store_sk#17, ss_ticket_number#18, ss_net_paid#19, ss_sold_date_sk#20]
Condition : (((isnotnull(ss_ticket_number#18) AND isnotnull(ss_item_sk#15)) AND isnotnull(ss_store_sk#17)) AND isnotnull(ss_customer_sk#16))

(21) Project
Output [5]: [ss_item_sk#15, ss_customer_sk#16, ss_store_sk#17, ss_ticket_number#18, ss_net_paid#19]
Input [6]: [ss_item_sk#15, ss_customer_sk#16, ss_store_sk#17, ss_ticket_number#18, ss_net_paid#19, ss_sold_date_sk#20]

(22) BroadcastHashJoin [codegen id : 5]
Left keys [2]: [s_store_sk#1, c_customer_sk#10]
Right keys [2]: [ss_store_sk#17, ss_customer_sk#16]
Join type: Inner
Join condition: None

(23) Project [codegen id : 5]
Output [8]: [s_store_name#2, s_state#4, ca_state#7, c_first_name#12, c_last_name#13, ss_item_sk#15, ss_ticket_number#18, ss_net_paid#19]
Input [12]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#7, c_customer_sk#10, c_first_name#12, c_last_name#13, ss_item_sk#15, ss_customer_sk#16, ss_store_sk#17, ss_ticket_number#18, ss_net_paid#19]

(24) Scan parquet spark_catalog.default.item
Output [6]: [i_item_sk#21, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_color), EqualTo(i_color,pale                ), IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_current_price:decimal(7,2),i_size:string,i_color:string,i_units:string,i_manager_id:int>

(25) ColumnarToRow [codegen id : 4]
Input [6]: [i_item_sk#21, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26]

(26) Filter [codegen id : 4]
Input [6]: [i_item_sk#21, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26]
Condition : ((isnotnull(i_color#24) AND (i_color#24 = pale                )) AND isnotnull(i_item_sk#21))

(27) BroadcastExchange
Input [6]: [i_item_sk#21, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

(28) BroadcastHashJoin [codegen id : 5]
Left keys [1]: [ss_item_sk#15]
Right keys [1]: [i_item_sk#21]
Join type: Inner
Join condition: None

(29) Project [codegen id : 5]
Output [13]: [s_store_name#2, s_state#4, ca_state#7, c_first_name#12, c_last_name#13, ss_item_sk#15, ss_ticket_number#18, ss_net_paid#19, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26]
Input [14]: [s_store_name#2, s_state#4, ca_state#7, c_first_name#12, c_last_name#13, ss_item_sk#15, ss_ticket_number#18, ss_net_paid#19, i_item_sk#21, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26]

(30) Exchange
Input [13]: [s_store_name#2, s_state#4, ca_state#7, c_first_name#12, c_last_name#13, ss_item_sk#15, ss_ticket_number#18, ss_net_paid#19, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26]
Arguments: hashpartitioning(ss_ticket_number#18, ss_item_sk#15, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(31) Sort [codegen id : 6]
Input [13]: [s_store_name#2, s_state#4, ca_state#7, c_first_name#12, c_last_name#13, ss_item_sk#15, ss_ticket_number#18, ss_net_paid#19, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26]
Arguments: [ss_ticket_number#18 ASC NULLS FIRST, ss_item_sk#15 ASC NULLS FIRST], false, 0

(32) Scan parquet spark_catalog.default.store_returns
Output [3]: [sr_item_sk#27, sr_ticket_number#28, sr_returned_date_sk#29]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_returns]
PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)]
ReadSchema: struct<sr_item_sk:int,sr_ticket_number:int>

(33) ColumnarToRow [codegen id : 7]
Input [3]: [sr_item_sk#27, sr_ticket_number#28, sr_returned_date_sk#29]

(34) Filter [codegen id : 7]
Input [3]: [sr_item_sk#27, sr_ticket_number#28, sr_returned_date_sk#29]
Condition : (isnotnull(sr_ticket_number#28) AND isnotnull(sr_item_sk#27))

(35) Project [codegen id : 7]
Output [2]: [sr_item_sk#27, sr_ticket_number#28]
Input [3]: [sr_item_sk#27, sr_ticket_number#28, sr_returned_date_sk#29]

(36) Exchange
Input [2]: [sr_item_sk#27, sr_ticket_number#28]
Arguments: hashpartitioning(sr_ticket_number#28, sr_item_sk#27, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(37) Sort [codegen id : 8]
Input [2]: [sr_item_sk#27, sr_ticket_number#28]
Arguments: [sr_ticket_number#28 ASC NULLS FIRST, sr_item_sk#27 ASC NULLS FIRST], false, 0

(38) SortMergeJoin [codegen id : 9]
Left keys [2]: [ss_ticket_number#18, ss_item_sk#15]
Right keys [2]: [sr_ticket_number#28, sr_item_sk#27]
Join type: Inner
Join condition: None

(39) Project [codegen id : 9]
Output [11]: [ss_net_paid#19, s_store_name#2, s_state#4, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26, c_first_name#12, c_last_name#13, ca_state#7]
Input [15]: [s_store_name#2, s_state#4, ca_state#7, c_first_name#12, c_last_name#13, ss_item_sk#15, ss_ticket_number#18, ss_net_paid#19, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26, sr_item_sk#27, sr_ticket_number#28]

(40) HashAggregate [codegen id : 9]
Input [11]: [ss_net_paid#19, s_store_name#2, s_state#4, i_current_price#22, i_size#23, i_color#24, i_units#25, i_manager_id#26, c_first_name#12, c_last_name#13, ca_state#7]
Keys [10]: [c_last_name#13, c_first_name#12, s_store_name#2, ca_state#7, s_state#4, i_color#24, i_current_price#22, i_manager_id#26, i_units#25, i_size#23]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#19))]
Aggregate Attributes [1]: [sum#30]
Results [11]: [c_last_name#13, c_first_name#12, s_store_name#2, ca_state#7, s_state#4, i_color#24, i_current_price#22, i_manager_id#26, i_units#25, i_size#23, sum#31]

(41) Exchange
Input [11]: [c_last_name#13, c_first_name#12, s_store_name#2, ca_state#7, s_state#4, i_color#24, i_current_price#22, i_manager_id#26, i_units#25, i_size#23, sum#31]
Arguments: hashpartitioning(c_last_name#13, c_first_name#12, s_store_name#2, ca_state#7, s_state#4, i_color#24, i_current_price#22, i_manager_id#26, i_units#25, i_size#23, 5), ENSURE_REQUIREMENTS, [plan_id=7]

(42) HashAggregate [codegen id : 10]
Input [11]: [c_last_name#13, c_first_name#12, s_store_name#2, ca_state#7, s_state#4, i_color#24, i_current_price#22, i_manager_id#26, i_units#25, i_size#23, sum#31]
Keys [10]: [c_last_name#13, c_first_name#12, s_store_name#2, ca_state#7, s_state#4, i_color#24, i_current_price#22, i_manager_id#26, i_units#25, i_size#23]
Functions [1]: [sum(UnscaledValue(ss_net_paid#19))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#19))#32]
Results [4]: [c_last_name#13, c_first_name#12, s_store_name#2, MakeDecimal(sum(UnscaledValue(ss_net_paid#19))#32,17,2) AS netpaid#33]

(43) HashAggregate [codegen id : 10]
Input [4]: [c_last_name#13, c_first_name#12, s_store_name#2, netpaid#33]
Keys [3]: [c_last_name#13, c_first_name#12, s_store_name#2]
Functions [1]: [partial_sum(netpaid#33)]
Aggregate Attributes [2]: [sum#34, isEmpty#35]
Results [5]: [c_last_name#13, c_first_name#12, s_store_name#2, sum#36, isEmpty#37]

(44) Exchange
Input [5]: [c_last_name#13, c_first_name#12, s_store_name#2, sum#36, isEmpty#37]
Arguments: hashpartitioning(c_last_name#13, c_first_name#12, s_store_name#2, 5), ENSURE_REQUIREMENTS, [plan_id=8]

(45) HashAggregate [codegen id : 11]
Input [5]: [c_last_name#13, c_first_name#12, s_store_name#2, sum#36, isEmpty#37]
Keys [3]: [c_last_name#13, c_first_name#12, s_store_name#2]
Functions [1]: [sum(netpaid#33)]
Aggregate Attributes [1]: [sum(netpaid#33)#38]
Results [4]: [c_last_name#13, c_first_name#12, s_store_name#2, sum(netpaid#33)#38 AS paid#39]

(46) Filter [codegen id : 11]
Input [4]: [c_last_name#13, c_first_name#12, s_store_name#2, paid#39]
Condition : (isnotnull(paid#39) AND (cast(paid#39 as decimal(33,8)) > cast(Subquery scalar-subquery#40, [id=#9] as decimal(33,8))))

(47) Exchange
Input [4]: [c_last_name#13, c_first_name#12, s_store_name#2, paid#39]
Arguments: rangepartitioning(c_last_name#13 ASC NULLS FIRST, c_first_name#12 ASC NULLS FIRST, s_store_name#2 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [plan_id=10]

(48) Sort [codegen id : 12]
Input [4]: [c_last_name#13, c_first_name#12, s_store_name#2, paid#39]
Arguments: [c_last_name#13 ASC NULLS FIRST, c_first_name#12 ASC NULLS FIRST, s_store_name#2 ASC NULLS FIRST], true, 0

===== Subqueries =====

Subquery:1 Hosting operator id = 46 Hosting Expression = Subquery scalar-subquery#40, [id=#9]
* HashAggregate (76)
+- Exchange (75)
   +- * HashAggregate (74)
      +- * HashAggregate (73)
         +- Exchange (72)
            +- * HashAggregate (71)
               +- * Project (70)
                  +- * SortMergeJoin Inner (69)
                     :- * Sort (66)
                     :  +- Exchange (65)
                     :     +- * Project (64)
                     :        +- * SortMergeJoin Inner (63)
                     :           :- * Sort (57)
                     :           :  +- Exchange (56)
                     :           :     +- * Project (55)
                     :           :        +- * BroadcastHashJoin Inner BuildLeft (54)
                     :           :           :- ReusedExchange (49)
                     :           :           +- * Project (53)
                     :           :              +- * Filter (52)
                     :           :                 +- * ColumnarToRow (51)
                     :           :                    +- Scan parquet spark_catalog.default.store_sales (50)
                     :           +- * Sort (62)
                     :              +- Exchange (61)
                     :                 +- * Filter (60)
                     :                    +- * ColumnarToRow (59)
                     :                       +- Scan parquet spark_catalog.default.item (58)
                     +- * Sort (68)
                        +- ReusedExchange (67)


(49) ReusedExchange [Reuses operator id: 17]
Output [7]: [s_store_sk#41, s_store_name#42, s_state#43, ca_state#44, c_customer_sk#45, c_first_name#46, c_last_name#47]

(50) Scan parquet spark_catalog.default.store_sales
Output [6]: [ss_item_sk#48, ss_customer_sk#49, ss_store_sk#50, ss_ticket_number#51, ss_net_paid#52, ss_sold_date_sk#53]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_item_sk:int,ss_customer_sk:int,ss_store_sk:int,ss_ticket_number:int,ss_net_paid:decimal(7,2)>

(51) ColumnarToRow
Input [6]: [ss_item_sk#48, ss_customer_sk#49, ss_store_sk#50, ss_ticket_number#51, ss_net_paid#52, ss_sold_date_sk#53]

(52) Filter
Input [6]: [ss_item_sk#48, ss_customer_sk#49, ss_store_sk#50, ss_ticket_number#51, ss_net_paid#52, ss_sold_date_sk#53]
Condition : (((isnotnull(ss_ticket_number#51) AND isnotnull(ss_item_sk#48)) AND isnotnull(ss_store_sk#50)) AND isnotnull(ss_customer_sk#49))

(53) Project
Output [5]: [ss_item_sk#48, ss_customer_sk#49, ss_store_sk#50, ss_ticket_number#51, ss_net_paid#52]
Input [6]: [ss_item_sk#48, ss_customer_sk#49, ss_store_sk#50, ss_ticket_number#51, ss_net_paid#52, ss_sold_date_sk#53]

(54) BroadcastHashJoin [codegen id : 4]
Left keys [2]: [s_store_sk#41, c_customer_sk#45]
Right keys [2]: [ss_store_sk#50, ss_customer_sk#49]
Join type: Inner
Join condition: None

(55) Project [codegen id : 4]
Output [8]: [s_store_name#42, s_state#43, ca_state#44, c_first_name#46, c_last_name#47, ss_item_sk#48, ss_ticket_number#51, ss_net_paid#52]
Input [12]: [s_store_sk#41, s_store_name#42, s_state#43, ca_state#44, c_customer_sk#45, c_first_name#46, c_last_name#47, ss_item_sk#48, ss_customer_sk#49, ss_store_sk#50, ss_ticket_number#51, ss_net_paid#52]

(56) Exchange
Input [8]: [s_store_name#42, s_state#43, ca_state#44, c_first_name#46, c_last_name#47, ss_item_sk#48, ss_ticket_number#51, ss_net_paid#52]
Arguments: hashpartitioning(ss_item_sk#48, 5), ENSURE_REQUIREMENTS, [plan_id=11]

(57) Sort [codegen id : 5]
Input [8]: [s_store_name#42, s_state#43, ca_state#44, c_first_name#46, c_last_name#47, ss_item_sk#48, ss_ticket_number#51, ss_net_paid#52]
Arguments: [ss_item_sk#48 ASC NULLS FIRST], false, 0

(58) Scan parquet spark_catalog.default.item
Output [6]: [i_item_sk#54, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_current_price:decimal(7,2),i_size:string,i_color:string,i_units:string,i_manager_id:int>

(59) ColumnarToRow [codegen id : 6]
Input [6]: [i_item_sk#54, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59]

(60) Filter [codegen id : 6]
Input [6]: [i_item_sk#54, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59]
Condition : isnotnull(i_item_sk#54)

(61) Exchange
Input [6]: [i_item_sk#54, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59]
Arguments: hashpartitioning(i_item_sk#54, 5), ENSURE_REQUIREMENTS, [plan_id=12]

(62) Sort [codegen id : 7]
Input [6]: [i_item_sk#54, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59]
Arguments: [i_item_sk#54 ASC NULLS FIRST], false, 0

(63) SortMergeJoin [codegen id : 8]
Left keys [1]: [ss_item_sk#48]
Right keys [1]: [i_item_sk#54]
Join type: Inner
Join condition: None

(64) Project [codegen id : 8]
Output [13]: [s_store_name#42, s_state#43, ca_state#44, c_first_name#46, c_last_name#47, ss_item_sk#48, ss_ticket_number#51, ss_net_paid#52, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59]
Input [14]: [s_store_name#42, s_state#43, ca_state#44, c_first_name#46, c_last_name#47, ss_item_sk#48, ss_ticket_number#51, ss_net_paid#52, i_item_sk#54, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59]

(65) Exchange
Input [13]: [s_store_name#42, s_state#43, ca_state#44, c_first_name#46, c_last_name#47, ss_item_sk#48, ss_ticket_number#51, ss_net_paid#52, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59]
Arguments: hashpartitioning(ss_ticket_number#51, ss_item_sk#48, 5), ENSURE_REQUIREMENTS, [plan_id=13]

(66) Sort [codegen id : 9]
Input [13]: [s_store_name#42, s_state#43, ca_state#44, c_first_name#46, c_last_name#47, ss_item_sk#48, ss_ticket_number#51, ss_net_paid#52, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59]
Arguments: [ss_ticket_number#51 ASC NULLS FIRST, ss_item_sk#48 ASC NULLS FIRST], false, 0

(67) ReusedExchange [Reuses operator id: 36]
Output [2]: [sr_item_sk#60, sr_ticket_number#61]

(68) Sort [codegen id : 11]
Input [2]: [sr_item_sk#60, sr_ticket_number#61]
Arguments: [sr_ticket_number#61 ASC NULLS FIRST, sr_item_sk#60 ASC NULLS FIRST], false, 0

(69) SortMergeJoin [codegen id : 12]
Left keys [2]: [ss_ticket_number#51, ss_item_sk#48]
Right keys [2]: [sr_ticket_number#61, sr_item_sk#60]
Join type: Inner
Join condition: None

(70) Project [codegen id : 12]
Output [11]: [ss_net_paid#52, s_store_name#42, s_state#43, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59, c_first_name#46, c_last_name#47, ca_state#44]
Input [15]: [s_store_name#42, s_state#43, ca_state#44, c_first_name#46, c_last_name#47, ss_item_sk#48, ss_ticket_number#51, ss_net_paid#52, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59, sr_item_sk#60, sr_ticket_number#61]

(71) HashAggregate [codegen id : 12]
Input [11]: [ss_net_paid#52, s_store_name#42, s_state#43, i_current_price#55, i_size#56, i_color#57, i_units#58, i_manager_id#59, c_first_name#46, c_last_name#47, ca_state#44]
Keys [10]: [c_last_name#47, c_first_name#46, s_store_name#42, ca_state#44, s_state#43, i_color#57, i_current_price#55, i_manager_id#59, i_units#58, i_size#56]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#52))]
Aggregate Attributes [1]: [sum#62]
Results [11]: [c_last_name#47, c_first_name#46, s_store_name#42, ca_state#44, s_state#43, i_color#57, i_current_price#55, i_manager_id#59, i_units#58, i_size#56, sum#63]

(72) Exchange
Input [11]: [c_last_name#47, c_first_name#46, s_store_name#42, ca_state#44, s_state#43, i_color#57, i_current_price#55, i_manager_id#59, i_units#58, i_size#56, sum#63]
Arguments: hashpartitioning(c_last_name#47, c_first_name#46, s_store_name#42, ca_state#44, s_state#43, i_color#57, i_current_price#55, i_manager_id#59, i_units#58, i_size#56, 5), ENSURE_REQUIREMENTS, [plan_id=14]

(73) HashAggregate [codegen id : 13]
Input [11]: [c_last_name#47, c_first_name#46, s_store_name#42, ca_state#44, s_state#43, i_color#57, i_current_price#55, i_manager_id#59, i_units#58, i_size#56, sum#63]
Keys [10]: [c_last_name#47, c_first_name#46, s_store_name#42, ca_state#44, s_state#43, i_color#57, i_current_price#55, i_manager_id#59, i_units#58, i_size#56]
Functions [1]: [sum(UnscaledValue(ss_net_paid#52))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#52))#32]
Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#52))#32,17,2) AS netpaid#64]

(74) HashAggregate [codegen id : 13]
Input [1]: [netpaid#64]
Keys: []
Functions [1]: [partial_avg(netpaid#64)]
Aggregate Attributes [2]: [sum#65, count#66]
Results [2]: [sum#67, count#68]

(75) Exchange
Input [2]: [sum#67, count#68]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=15]

(76) HashAggregate [codegen id : 14]
Input [2]: [sum#67, count#68]
Keys: []
Functions [1]: [avg(netpaid#64)]
Aggregate Attributes [1]: [avg(netpaid#64)#69]
Results [1]: [(0.05 * avg(netpaid#64)#69) AS (0.05 * avg(netpaid))#70]


