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


(1) Scan parquet spark_catalog.default.store_sales
Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6]
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)>

(2) ColumnarToRow [codegen id : 1]
Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6]

(3) Filter [codegen id : 1]
Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6]
Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2))

(4) Project [codegen id : 1]
Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6]

(5) Exchange
Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=1]

(6) Sort [codegen id : 2]
Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0

(7) Scan parquet spark_catalog.default.store_returns
Output [3]: [sr_item_sk#7, sr_ticket_number#8, sr_returned_date_sk#9]
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>

(8) ColumnarToRow [codegen id : 3]
Input [3]: [sr_item_sk#7, sr_ticket_number#8, sr_returned_date_sk#9]

(9) Filter [codegen id : 3]
Input [3]: [sr_item_sk#7, sr_ticket_number#8, sr_returned_date_sk#9]
Condition : (isnotnull(sr_ticket_number#8) AND isnotnull(sr_item_sk#7))

(10) Project [codegen id : 3]
Output [2]: [sr_item_sk#7, sr_ticket_number#8]
Input [3]: [sr_item_sk#7, sr_ticket_number#8, sr_returned_date_sk#9]

(11) Exchange
Input [2]: [sr_item_sk#7, sr_ticket_number#8]
Arguments: hashpartitioning(sr_ticket_number#8, sr_item_sk#7, 5), ENSURE_REQUIREMENTS, [plan_id=2]

(12) Sort [codegen id : 4]
Input [2]: [sr_item_sk#7, sr_ticket_number#8]
Arguments: [sr_ticket_number#8 ASC NULLS FIRST, sr_item_sk#7 ASC NULLS FIRST], false, 0

(13) SortMergeJoin [codegen id : 9]
Left keys [2]: [ss_ticket_number#4, ss_item_sk#1]
Right keys [2]: [sr_ticket_number#8, sr_item_sk#7]
Join type: Inner
Join condition: None

(14) Project [codegen id : 9]
Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5]
Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, sr_item_sk#7, sr_ticket_number#8]

(15) Scan parquet spark_catalog.default.store
Output [5]: [s_store_sk#10, s_store_name#11, s_market_id#12, s_state#13, s_zip#14]
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>

(16) ColumnarToRow [codegen id : 5]
Input [5]: [s_store_sk#10, s_store_name#11, s_market_id#12, s_state#13, s_zip#14]

(17) Filter [codegen id : 5]
Input [5]: [s_store_sk#10, s_store_name#11, s_market_id#12, s_state#13, s_zip#14]
Condition : (((isnotnull(s_market_id#12) AND (s_market_id#12 = 8)) AND isnotnull(s_store_sk#10)) AND isnotnull(s_zip#14))

(18) Project [codegen id : 5]
Output [4]: [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
Input [5]: [s_store_sk#10, s_store_name#11, s_market_id#12, s_state#13, s_zip#14]

(19) BroadcastExchange
Input [4]: [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]

(20) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ss_store_sk#3]
Right keys [1]: [s_store_sk#10]
Join type: Inner
Join condition: None

(21) Project [codegen id : 9]
Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14]
Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5, s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]

(22) Scan parquet spark_catalog.default.item
Output [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_color), EqualTo(i_color,chiffon             ), 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>

(23) ColumnarToRow [codegen id : 6]
Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]

(24) Filter [codegen id : 6]
Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
Condition : ((isnotnull(i_color#18) AND (i_color#18 = chiffon             )) AND isnotnull(i_item_sk#15))

(25) BroadcastExchange
Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

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

(27) Project [codegen id : 9]
Output [10]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]

(28) Scan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)]
ReadSchema: struct<c_customer_sk:int,c_first_name:string,c_last_name:string,c_birth_country:string>

(29) ColumnarToRow [codegen id : 7]
Input [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]

(30) Filter [codegen id : 7]
Input [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
Condition : (isnotnull(c_customer_sk#21) AND isnotnull(c_birth_country#24))

(31) BroadcastExchange
Input [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=5]

(32) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ss_customer_sk#2]
Right keys [1]: [c_customer_sk#21]
Join type: Inner
Join condition: None

(33) Project [codegen id : 9]
Output [12]: [ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, c_birth_country#24]
Input [14]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]

(34) Scan parquet spark_catalog.default.customer_address
Output [3]: [ca_state#25, ca_zip#26, ca_country#27]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)]
ReadSchema: struct<ca_state:string,ca_zip:string,ca_country:string>

(35) ColumnarToRow [codegen id : 8]
Input [3]: [ca_state#25, ca_zip#26, ca_country#27]

(36) Filter [codegen id : 8]
Input [3]: [ca_state#25, ca_zip#26, ca_country#27]
Condition : (isnotnull(ca_country#27) AND isnotnull(ca_zip#26))

(37) BroadcastExchange
Input [3]: [ca_state#25, ca_zip#26, ca_country#27]
Arguments: HashedRelationBroadcastMode(List(upper(input[2, string, false]), input[1, string, false]),false), [plan_id=6]

(38) BroadcastHashJoin [codegen id : 9]
Left keys [2]: [c_birth_country#24, s_zip#14]
Right keys [2]: [upper(ca_country#27), ca_zip#26]
Join type: Inner
Join condition: None

(39) Project [codegen id : 9]
Output [11]: [ss_net_paid#5, s_store_name#11, s_state#13, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, ca_state#25]
Input [15]: [ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, c_birth_country#24, ca_state#25, ca_zip#26, ca_country#27]

(40) HashAggregate [codegen id : 9]
Input [11]: [ss_net_paid#5, s_store_name#11, s_state#13, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, ca_state#25]
Keys [10]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))]
Aggregate Attributes [1]: [sum#28]
Results [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#29]

(41) Exchange
Input [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#29]
Arguments: hashpartitioning(c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, 5), ENSURE_REQUIREMENTS, [plan_id=7]

(42) HashAggregate [codegen id : 10]
Input [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#29]
Keys [10]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17]
Functions [1]: [sum(UnscaledValue(ss_net_paid#5))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#30]
Results [4]: [c_last_name#23, c_first_name#22, s_store_name#11, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#30,17,2) AS netpaid#31]

(43) HashAggregate [codegen id : 10]
Input [4]: [c_last_name#23, c_first_name#22, s_store_name#11, netpaid#31]
Keys [3]: [c_last_name#23, c_first_name#22, s_store_name#11]
Functions [1]: [partial_sum(netpaid#31)]
Aggregate Attributes [2]: [sum#32, isEmpty#33]
Results [5]: [c_last_name#23, c_first_name#22, s_store_name#11, sum#34, isEmpty#35]

(44) Exchange
Input [5]: [c_last_name#23, c_first_name#22, s_store_name#11, sum#34, isEmpty#35]
Arguments: hashpartitioning(c_last_name#23, c_first_name#22, s_store_name#11, 5), ENSURE_REQUIREMENTS, [plan_id=8]

(45) HashAggregate [codegen id : 11]
Input [5]: [c_last_name#23, c_first_name#22, s_store_name#11, sum#34, isEmpty#35]
Keys [3]: [c_last_name#23, c_first_name#22, s_store_name#11]
Functions [1]: [sum(netpaid#31)]
Aggregate Attributes [1]: [sum(netpaid#31)#36]
Results [4]: [c_last_name#23, c_first_name#22, s_store_name#11, sum(netpaid#31)#36 AS paid#37]

(46) Filter [codegen id : 11]
Input [4]: [c_last_name#23, c_first_name#22, s_store_name#11, paid#37]
Condition : (isnotnull(paid#37) AND (cast(paid#37 as decimal(33,8)) > cast(Subquery scalar-subquery#38, [id=#9] as decimal(33,8))))

===== Subqueries =====

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


(47) ReusedExchange [Reuses operator id: 5]
Output [5]: [ss_item_sk#39, ss_customer_sk#40, ss_store_sk#41, ss_ticket_number#42, ss_net_paid#43]

(48) Sort [codegen id : 2]
Input [5]: [ss_item_sk#39, ss_customer_sk#40, ss_store_sk#41, ss_ticket_number#42, ss_net_paid#43]
Arguments: [ss_ticket_number#42 ASC NULLS FIRST, ss_item_sk#39 ASC NULLS FIRST], false, 0

(49) ReusedExchange [Reuses operator id: 11]
Output [2]: [sr_item_sk#44, sr_ticket_number#45]

(50) Sort [codegen id : 4]
Input [2]: [sr_item_sk#44, sr_ticket_number#45]
Arguments: [sr_ticket_number#45 ASC NULLS FIRST, sr_item_sk#44 ASC NULLS FIRST], false, 0

(51) SortMergeJoin [codegen id : 9]
Left keys [2]: [ss_ticket_number#42, ss_item_sk#39]
Right keys [2]: [sr_ticket_number#45, sr_item_sk#44]
Join type: Inner
Join condition: None

(52) Project [codegen id : 9]
Output [4]: [ss_item_sk#39, ss_customer_sk#40, ss_store_sk#41, ss_net_paid#43]
Input [7]: [ss_item_sk#39, ss_customer_sk#40, ss_store_sk#41, ss_ticket_number#42, ss_net_paid#43, sr_item_sk#44, sr_ticket_number#45]

(53) ReusedExchange [Reuses operator id: 19]
Output [4]: [s_store_sk#46, s_store_name#47, s_state#48, s_zip#49]

(54) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ss_store_sk#41]
Right keys [1]: [s_store_sk#46]
Join type: Inner
Join condition: None

(55) Project [codegen id : 9]
Output [6]: [ss_item_sk#39, ss_customer_sk#40, ss_net_paid#43, s_store_name#47, s_state#48, s_zip#49]
Input [8]: [ss_item_sk#39, ss_customer_sk#40, ss_store_sk#41, ss_net_paid#43, s_store_sk#46, s_store_name#47, s_state#48, s_zip#49]

(56) Scan parquet spark_catalog.default.item
Output [6]: [i_item_sk#50, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55]
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>

(57) ColumnarToRow [codegen id : 6]
Input [6]: [i_item_sk#50, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55]

(58) Filter [codegen id : 6]
Input [6]: [i_item_sk#50, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55]
Condition : isnotnull(i_item_sk#50)

(59) BroadcastExchange
Input [6]: [i_item_sk#50, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=10]

(60) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ss_item_sk#39]
Right keys [1]: [i_item_sk#50]
Join type: Inner
Join condition: None

(61) Project [codegen id : 9]
Output [10]: [ss_customer_sk#40, ss_net_paid#43, s_store_name#47, s_state#48, s_zip#49, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55]
Input [12]: [ss_item_sk#39, ss_customer_sk#40, ss_net_paid#43, s_store_name#47, s_state#48, s_zip#49, i_item_sk#50, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55]

(62) ReusedExchange [Reuses operator id: 31]
Output [4]: [c_customer_sk#56, c_first_name#57, c_last_name#58, c_birth_country#59]

(63) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ss_customer_sk#40]
Right keys [1]: [c_customer_sk#56]
Join type: Inner
Join condition: None

(64) Project [codegen id : 9]
Output [12]: [ss_net_paid#43, s_store_name#47, s_state#48, s_zip#49, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55, c_first_name#57, c_last_name#58, c_birth_country#59]
Input [14]: [ss_customer_sk#40, ss_net_paid#43, s_store_name#47, s_state#48, s_zip#49, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55, c_customer_sk#56, c_first_name#57, c_last_name#58, c_birth_country#59]

(65) ReusedExchange [Reuses operator id: 37]
Output [3]: [ca_state#60, ca_zip#61, ca_country#62]

(66) BroadcastHashJoin [codegen id : 9]
Left keys [2]: [c_birth_country#59, s_zip#49]
Right keys [2]: [upper(ca_country#62), ca_zip#61]
Join type: Inner
Join condition: None

(67) Project [codegen id : 9]
Output [11]: [ss_net_paid#43, s_store_name#47, s_state#48, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55, c_first_name#57, c_last_name#58, ca_state#60]
Input [15]: [ss_net_paid#43, s_store_name#47, s_state#48, s_zip#49, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55, c_first_name#57, c_last_name#58, c_birth_country#59, ca_state#60, ca_zip#61, ca_country#62]

(68) HashAggregate [codegen id : 9]
Input [11]: [ss_net_paid#43, s_store_name#47, s_state#48, i_current_price#51, i_size#52, i_color#53, i_units#54, i_manager_id#55, c_first_name#57, c_last_name#58, ca_state#60]
Keys [10]: [c_last_name#58, c_first_name#57, s_store_name#47, ca_state#60, s_state#48, i_color#53, i_current_price#51, i_manager_id#55, i_units#54, i_size#52]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#43))]
Aggregate Attributes [1]: [sum#63]
Results [11]: [c_last_name#58, c_first_name#57, s_store_name#47, ca_state#60, s_state#48, i_color#53, i_current_price#51, i_manager_id#55, i_units#54, i_size#52, sum#64]

(69) Exchange
Input [11]: [c_last_name#58, c_first_name#57, s_store_name#47, ca_state#60, s_state#48, i_color#53, i_current_price#51, i_manager_id#55, i_units#54, i_size#52, sum#64]
Arguments: hashpartitioning(c_last_name#58, c_first_name#57, s_store_name#47, ca_state#60, s_state#48, i_color#53, i_current_price#51, i_manager_id#55, i_units#54, i_size#52, 5), ENSURE_REQUIREMENTS, [plan_id=11]

(70) HashAggregate [codegen id : 10]
Input [11]: [c_last_name#58, c_first_name#57, s_store_name#47, ca_state#60, s_state#48, i_color#53, i_current_price#51, i_manager_id#55, i_units#54, i_size#52, sum#64]
Keys [10]: [c_last_name#58, c_first_name#57, s_store_name#47, ca_state#60, s_state#48, i_color#53, i_current_price#51, i_manager_id#55, i_units#54, i_size#52]
Functions [1]: [sum(UnscaledValue(ss_net_paid#43))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#43))#30]
Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#43))#30,17,2) AS netpaid#65]

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

(72) Exchange
Input [2]: [sum#68, count#69]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=12]

(73) HashAggregate [codegen id : 11]
Input [2]: [sum#68, count#69]
Keys: []
Functions [1]: [avg(netpaid#65)]
Aggregate Attributes [1]: [avg(netpaid#65)#70]
Results [1]: [(0.05 * avg(netpaid#65)#70) AS (0.05 * avg(netpaid))#71]


