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


(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 : 2]
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 : 2]
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)) AND might_contain(Subquery scalar-subquery#7, [id=#1], xxhash64(ss_store_sk#3, 42)))

(4) Project [codegen id : 2]
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) Scan parquet spark_catalog.default.item
Output [6]: [i_item_sk#8, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13]
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>

(6) ColumnarToRow [codegen id : 1]
Input [6]: [i_item_sk#8, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13]

(7) Filter [codegen id : 1]
Input [6]: [i_item_sk#8, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13]
Condition : ((isnotnull(i_color#11) AND (i_color#11 = chiffon             )) AND isnotnull(i_item_sk#8))

(8) BroadcastExchange
Input [6]: [i_item_sk#8, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]

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

(10) Project [codegen id : 2]
Output [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13]
Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_item_sk#8, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13]

(11) Exchange
Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13]
Arguments: hashpartitioning(ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [plan_id=3]

(12) Sort [codegen id : 3]
Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13]
Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0

(13) Scan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17]
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>

(14) ColumnarToRow [codegen id : 4]
Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17]

(15) Filter [codegen id : 4]
Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17]
Condition : (isnotnull(c_customer_sk#14) AND isnotnull(c_birth_country#17))

(16) Exchange
Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17]
Arguments: hashpartitioning(c_customer_sk#14, 5), ENSURE_REQUIREMENTS, [plan_id=4]

(17) Sort [codegen id : 5]
Input [4]: [c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17]
Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0

(18) SortMergeJoin [codegen id : 6]
Left keys [1]: [ss_customer_sk#2]
Right keys [1]: [c_customer_sk#14]
Join type: Inner
Join condition: None

(19) Project [codegen id : 6]
Output [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13, c_first_name#15, c_last_name#16, c_birth_country#17]
Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13, c_customer_sk#14, c_first_name#15, c_last_name#16, c_birth_country#17]

(20) Exchange
Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13, c_first_name#15, c_last_name#16, c_birth_country#17]
Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(21) Sort [codegen id : 7]
Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13, c_first_name#15, c_last_name#16, c_birth_country#17]
Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0

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

(23) ColumnarToRow [codegen id : 8]
Input [3]: [sr_item_sk#18, sr_ticket_number#19, sr_returned_date_sk#20]

(24) Filter [codegen id : 8]
Input [3]: [sr_item_sk#18, sr_ticket_number#19, sr_returned_date_sk#20]
Condition : (isnotnull(sr_ticket_number#19) AND isnotnull(sr_item_sk#18))

(25) Project [codegen id : 8]
Output [2]: [sr_item_sk#18, sr_ticket_number#19]
Input [3]: [sr_item_sk#18, sr_ticket_number#19, sr_returned_date_sk#20]

(26) Exchange
Input [2]: [sr_item_sk#18, sr_ticket_number#19]
Arguments: hashpartitioning(sr_ticket_number#19, sr_item_sk#18, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(27) Sort [codegen id : 9]
Input [2]: [sr_item_sk#18, sr_ticket_number#19]
Arguments: [sr_ticket_number#19 ASC NULLS FIRST, sr_item_sk#18 ASC NULLS FIRST], false, 0

(28) SortMergeJoin [codegen id : 12]
Left keys [2]: [ss_ticket_number#4, ss_item_sk#1]
Right keys [2]: [sr_ticket_number#19, sr_item_sk#18]
Join type: Inner
Join condition: None

(29) Project [codegen id : 12]
Output [10]: [ss_store_sk#3, ss_net_paid#5, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13, c_first_name#15, c_last_name#16, c_birth_country#17]
Input [14]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13, c_first_name#15, c_last_name#16, c_birth_country#17, sr_item_sk#18, sr_ticket_number#19]

(30) Scan parquet spark_catalog.default.store
Output [5]: [s_store_sk#21, s_store_name#22, s_market_id#23, s_state#24, s_zip#25]
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>

(31) ColumnarToRow [codegen id : 10]
Input [5]: [s_store_sk#21, s_store_name#22, s_market_id#23, s_state#24, s_zip#25]

(32) Filter [codegen id : 10]
Input [5]: [s_store_sk#21, s_store_name#22, s_market_id#23, s_state#24, s_zip#25]
Condition : (((isnotnull(s_market_id#23) AND (s_market_id#23 = 8)) AND isnotnull(s_store_sk#21)) AND isnotnull(s_zip#25))

(33) Project [codegen id : 10]
Output [4]: [s_store_sk#21, s_store_name#22, s_state#24, s_zip#25]
Input [5]: [s_store_sk#21, s_store_name#22, s_market_id#23, s_state#24, s_zip#25]

(34) BroadcastExchange
Input [4]: [s_store_sk#21, s_store_name#22, s_state#24, s_zip#25]
Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [plan_id=7]

(35) Scan parquet spark_catalog.default.customer_address
Output [3]: [ca_state#26, ca_zip#27, ca_country#28]
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>

(36) ColumnarToRow
Input [3]: [ca_state#26, ca_zip#27, ca_country#28]

(37) Filter
Input [3]: [ca_state#26, ca_zip#27, ca_country#28]
Condition : (isnotnull(ca_country#28) AND isnotnull(ca_zip#27))

(38) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [s_zip#25]
Right keys [1]: [ca_zip#27]
Join type: Inner
Join condition: None

(39) Project [codegen id : 11]
Output [5]: [s_store_sk#21, s_store_name#22, s_state#24, ca_state#26, ca_country#28]
Input [7]: [s_store_sk#21, s_store_name#22, s_state#24, s_zip#25, ca_state#26, ca_zip#27, ca_country#28]

(40) BroadcastExchange
Input [5]: [s_store_sk#21, s_store_name#22, s_state#24, ca_state#26, ca_country#28]
Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [plan_id=8]

(41) BroadcastHashJoin [codegen id : 12]
Left keys [2]: [ss_store_sk#3, c_birth_country#17]
Right keys [2]: [s_store_sk#21, upper(ca_country#28)]
Join type: Inner
Join condition: None

(42) Project [codegen id : 12]
Output [11]: [ss_net_paid#5, s_store_name#22, s_state#24, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13, c_first_name#15, c_last_name#16, ca_state#26]
Input [15]: [ss_store_sk#3, ss_net_paid#5, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13, c_first_name#15, c_last_name#16, c_birth_country#17, s_store_sk#21, s_store_name#22, s_state#24, ca_state#26, ca_country#28]

(43) HashAggregate [codegen id : 12]
Input [11]: [ss_net_paid#5, s_store_name#22, s_state#24, i_current_price#9, i_size#10, i_color#11, i_units#12, i_manager_id#13, c_first_name#15, c_last_name#16, ca_state#26]
Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#22, ca_state#26, s_state#24, i_color#11, i_current_price#9, i_manager_id#13, i_units#12, i_size#10]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))]
Aggregate Attributes [1]: [sum#29]
Results [11]: [c_last_name#16, c_first_name#15, s_store_name#22, ca_state#26, s_state#24, i_color#11, i_current_price#9, i_manager_id#13, i_units#12, i_size#10, sum#30]

(44) Exchange
Input [11]: [c_last_name#16, c_first_name#15, s_store_name#22, ca_state#26, s_state#24, i_color#11, i_current_price#9, i_manager_id#13, i_units#12, i_size#10, sum#30]
Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#22, ca_state#26, s_state#24, i_color#11, i_current_price#9, i_manager_id#13, i_units#12, i_size#10, 5), ENSURE_REQUIREMENTS, [plan_id=9]

(45) HashAggregate [codegen id : 13]
Input [11]: [c_last_name#16, c_first_name#15, s_store_name#22, ca_state#26, s_state#24, i_color#11, i_current_price#9, i_manager_id#13, i_units#12, i_size#10, sum#30]
Keys [10]: [c_last_name#16, c_first_name#15, s_store_name#22, ca_state#26, s_state#24, i_color#11, i_current_price#9, i_manager_id#13, i_units#12, i_size#10]
Functions [1]: [sum(UnscaledValue(ss_net_paid#5))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#31]
Results [4]: [c_last_name#16, c_first_name#15, s_store_name#22, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#31,17,2) AS netpaid#32]

(46) HashAggregate [codegen id : 13]
Input [4]: [c_last_name#16, c_first_name#15, s_store_name#22, netpaid#32]
Keys [3]: [c_last_name#16, c_first_name#15, s_store_name#22]
Functions [1]: [partial_sum(netpaid#32)]
Aggregate Attributes [2]: [sum#33, isEmpty#34]
Results [5]: [c_last_name#16, c_first_name#15, s_store_name#22, sum#35, isEmpty#36]

(47) Exchange
Input [5]: [c_last_name#16, c_first_name#15, s_store_name#22, sum#35, isEmpty#36]
Arguments: hashpartitioning(c_last_name#16, c_first_name#15, s_store_name#22, 5), ENSURE_REQUIREMENTS, [plan_id=10]

(48) HashAggregate [codegen id : 14]
Input [5]: [c_last_name#16, c_first_name#15, s_store_name#22, sum#35, isEmpty#36]
Keys [3]: [c_last_name#16, c_first_name#15, s_store_name#22]
Functions [1]: [sum(netpaid#32)]
Aggregate Attributes [1]: [sum(netpaid#32)#37]
Results [4]: [c_last_name#16, c_first_name#15, s_store_name#22, sum(netpaid#32)#37 AS paid#38]

(49) Filter [codegen id : 14]
Input [4]: [c_last_name#16, c_first_name#15, s_store_name#22, paid#38]
Condition : (isnotnull(paid#38) AND (cast(paid#38 as decimal(33,8)) > cast(Subquery scalar-subquery#39, [id=#11] as decimal(33,8))))

===== Subqueries =====

Subquery:1 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquery#39, [id=#11]
* HashAggregate (96)
+- Exchange (95)
   +- * HashAggregate (94)
      +- * HashAggregate (93)
         +- Exchange (92)
            +- * HashAggregate (91)
               +- * Project (90)
                  +- * SortMergeJoin Inner (89)
                     :- * Sort (83)
                     :  +- Exchange (82)
                     :     +- * Project (81)
                     :        +- * SortMergeJoin Inner (80)
                     :           :- * Sort (77)
                     :           :  +- Exchange (76)
                     :           :     +- * Project (75)
                     :           :        +- * SortMergeJoin Inner (74)
                     :           :           :- * Sort (71)
                     :           :           :  +- Exchange (70)
                     :           :           :     +- * Project (69)
                     :           :           :        +- * SortMergeJoin Inner (68)
                     :           :           :           :- * Sort (62)
                     :           :           :           :  +- Exchange (61)
                     :           :           :           :     +- * Project (60)
                     :           :           :           :        +- * BroadcastHashJoin Inner BuildRight (59)
                     :           :           :           :           :- * Project (53)
                     :           :           :           :           :  +- * Filter (52)
                     :           :           :           :           :     +- * ColumnarToRow (51)
                     :           :           :           :           :        +- Scan parquet spark_catalog.default.store_sales (50)
                     :           :           :           :           +- BroadcastExchange (58)
                     :           :           :           :              +- * Project (57)
                     :           :           :           :                 +- * Filter (56)
                     :           :           :           :                    +- * ColumnarToRow (55)
                     :           :           :           :                       +- Scan parquet spark_catalog.default.store (54)
                     :           :           :           +- * Sort (67)
                     :           :           :              +- Exchange (66)
                     :           :           :                 +- * Filter (65)
                     :           :           :                    +- * ColumnarToRow (64)
                     :           :           :                       +- Scan parquet spark_catalog.default.item (63)
                     :           :           +- * Sort (73)
                     :           :              +- ReusedExchange (72)
                     :           +- * Sort (79)
                     :              +- ReusedExchange (78)
                     +- * Sort (88)
                        +- Exchange (87)
                           +- * Filter (86)
                              +- * ColumnarToRow (85)
                                 +- Scan parquet spark_catalog.default.customer_address (84)


(50) Scan parquet spark_catalog.default.store_sales
Output [6]: [ss_item_sk#40, ss_customer_sk#41, ss_store_sk#42, ss_ticket_number#43, ss_net_paid#44, ss_sold_date_sk#45]
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 [codegen id : 2]
Input [6]: [ss_item_sk#40, ss_customer_sk#41, ss_store_sk#42, ss_ticket_number#43, ss_net_paid#44, ss_sold_date_sk#45]

(52) Filter [codegen id : 2]
Input [6]: [ss_item_sk#40, ss_customer_sk#41, ss_store_sk#42, ss_ticket_number#43, ss_net_paid#44, ss_sold_date_sk#45]
Condition : (((isnotnull(ss_ticket_number#43) AND isnotnull(ss_item_sk#40)) AND isnotnull(ss_store_sk#42)) AND isnotnull(ss_customer_sk#41))

(53) Project [codegen id : 2]
Output [5]: [ss_item_sk#40, ss_customer_sk#41, ss_store_sk#42, ss_ticket_number#43, ss_net_paid#44]
Input [6]: [ss_item_sk#40, ss_customer_sk#41, ss_store_sk#42, ss_ticket_number#43, ss_net_paid#44, ss_sold_date_sk#45]

(54) Scan parquet spark_catalog.default.store
Output [5]: [s_store_sk#46, s_store_name#47, s_market_id#48, s_state#49, s_zip#50]
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>

(55) ColumnarToRow [codegen id : 1]
Input [5]: [s_store_sk#46, s_store_name#47, s_market_id#48, s_state#49, s_zip#50]

(56) Filter [codegen id : 1]
Input [5]: [s_store_sk#46, s_store_name#47, s_market_id#48, s_state#49, s_zip#50]
Condition : (((isnotnull(s_market_id#48) AND (s_market_id#48 = 8)) AND isnotnull(s_store_sk#46)) AND isnotnull(s_zip#50))

(57) Project [codegen id : 1]
Output [4]: [s_store_sk#46, s_store_name#47, s_state#49, s_zip#50]
Input [5]: [s_store_sk#46, s_store_name#47, s_market_id#48, s_state#49, s_zip#50]

(58) BroadcastExchange
Input [4]: [s_store_sk#46, s_store_name#47, s_state#49, s_zip#50]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=12]

(59) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [ss_store_sk#42]
Right keys [1]: [s_store_sk#46]
Join type: Inner
Join condition: None

(60) Project [codegen id : 2]
Output [7]: [ss_item_sk#40, ss_customer_sk#41, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50]
Input [9]: [ss_item_sk#40, ss_customer_sk#41, ss_store_sk#42, ss_ticket_number#43, ss_net_paid#44, s_store_sk#46, s_store_name#47, s_state#49, s_zip#50]

(61) Exchange
Input [7]: [ss_item_sk#40, ss_customer_sk#41, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50]
Arguments: hashpartitioning(ss_item_sk#40, 5), ENSURE_REQUIREMENTS, [plan_id=13]

(62) Sort [codegen id : 3]
Input [7]: [ss_item_sk#40, ss_customer_sk#41, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50]
Arguments: [ss_item_sk#40 ASC NULLS FIRST], false, 0

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

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

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

(66) Exchange
Input [6]: [i_item_sk#51, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56]
Arguments: hashpartitioning(i_item_sk#51, 5), ENSURE_REQUIREMENTS, [plan_id=14]

(67) Sort [codegen id : 5]
Input [6]: [i_item_sk#51, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56]
Arguments: [i_item_sk#51 ASC NULLS FIRST], false, 0

(68) SortMergeJoin [codegen id : 6]
Left keys [1]: [ss_item_sk#40]
Right keys [1]: [i_item_sk#51]
Join type: Inner
Join condition: None

(69) Project [codegen id : 6]
Output [12]: [ss_item_sk#40, ss_customer_sk#41, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56]
Input [13]: [ss_item_sk#40, ss_customer_sk#41, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_item_sk#51, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56]

(70) Exchange
Input [12]: [ss_item_sk#40, ss_customer_sk#41, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56]
Arguments: hashpartitioning(ss_customer_sk#41, 5), ENSURE_REQUIREMENTS, [plan_id=15]

(71) Sort [codegen id : 7]
Input [12]: [ss_item_sk#40, ss_customer_sk#41, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56]
Arguments: [ss_customer_sk#41 ASC NULLS FIRST], false, 0

(72) ReusedExchange [Reuses operator id: 16]
Output [4]: [c_customer_sk#57, c_first_name#58, c_last_name#59, c_birth_country#60]

(73) Sort [codegen id : 9]
Input [4]: [c_customer_sk#57, c_first_name#58, c_last_name#59, c_birth_country#60]
Arguments: [c_customer_sk#57 ASC NULLS FIRST], false, 0

(74) SortMergeJoin [codegen id : 10]
Left keys [1]: [ss_customer_sk#41]
Right keys [1]: [c_customer_sk#57]
Join type: Inner
Join condition: None

(75) Project [codegen id : 10]
Output [14]: [ss_item_sk#40, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_first_name#58, c_last_name#59, c_birth_country#60]
Input [16]: [ss_item_sk#40, ss_customer_sk#41, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_customer_sk#57, c_first_name#58, c_last_name#59, c_birth_country#60]

(76) Exchange
Input [14]: [ss_item_sk#40, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_first_name#58, c_last_name#59, c_birth_country#60]
Arguments: hashpartitioning(ss_ticket_number#43, ss_item_sk#40, 5), ENSURE_REQUIREMENTS, [plan_id=16]

(77) Sort [codegen id : 11]
Input [14]: [ss_item_sk#40, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_first_name#58, c_last_name#59, c_birth_country#60]
Arguments: [ss_ticket_number#43 ASC NULLS FIRST, ss_item_sk#40 ASC NULLS FIRST], false, 0

(78) ReusedExchange [Reuses operator id: 26]
Output [2]: [sr_item_sk#61, sr_ticket_number#62]

(79) Sort [codegen id : 13]
Input [2]: [sr_item_sk#61, sr_ticket_number#62]
Arguments: [sr_ticket_number#62 ASC NULLS FIRST, sr_item_sk#61 ASC NULLS FIRST], false, 0

(80) SortMergeJoin [codegen id : 14]
Left keys [2]: [ss_ticket_number#43, ss_item_sk#40]
Right keys [2]: [sr_ticket_number#62, sr_item_sk#61]
Join type: Inner
Join condition: None

(81) Project [codegen id : 14]
Output [12]: [ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_first_name#58, c_last_name#59, c_birth_country#60]
Input [16]: [ss_item_sk#40, ss_ticket_number#43, ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_first_name#58, c_last_name#59, c_birth_country#60, sr_item_sk#61, sr_ticket_number#62]

(82) Exchange
Input [12]: [ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_first_name#58, c_last_name#59, c_birth_country#60]
Arguments: hashpartitioning(c_birth_country#60, s_zip#50, 5), ENSURE_REQUIREMENTS, [plan_id=17]

(83) Sort [codegen id : 15]
Input [12]: [ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_first_name#58, c_last_name#59, c_birth_country#60]
Arguments: [c_birth_country#60 ASC NULLS FIRST, s_zip#50 ASC NULLS FIRST], false, 0

(84) Scan parquet spark_catalog.default.customer_address
Output [3]: [ca_state#63, ca_zip#64, ca_country#65]
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>

(85) ColumnarToRow [codegen id : 16]
Input [3]: [ca_state#63, ca_zip#64, ca_country#65]

(86) Filter [codegen id : 16]
Input [3]: [ca_state#63, ca_zip#64, ca_country#65]
Condition : (isnotnull(ca_country#65) AND isnotnull(ca_zip#64))

(87) Exchange
Input [3]: [ca_state#63, ca_zip#64, ca_country#65]
Arguments: hashpartitioning(upper(ca_country#65), ca_zip#64, 5), ENSURE_REQUIREMENTS, [plan_id=18]

(88) Sort [codegen id : 17]
Input [3]: [ca_state#63, ca_zip#64, ca_country#65]
Arguments: [upper(ca_country#65) ASC NULLS FIRST, ca_zip#64 ASC NULLS FIRST], false, 0

(89) SortMergeJoin [codegen id : 18]
Left keys [2]: [c_birth_country#60, s_zip#50]
Right keys [2]: [upper(ca_country#65), ca_zip#64]
Join type: Inner
Join condition: None

(90) Project [codegen id : 18]
Output [11]: [ss_net_paid#44, s_store_name#47, s_state#49, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_first_name#58, c_last_name#59, ca_state#63]
Input [15]: [ss_net_paid#44, s_store_name#47, s_state#49, s_zip#50, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_first_name#58, c_last_name#59, c_birth_country#60, ca_state#63, ca_zip#64, ca_country#65]

(91) HashAggregate [codegen id : 18]
Input [11]: [ss_net_paid#44, s_store_name#47, s_state#49, i_current_price#52, i_size#53, i_color#54, i_units#55, i_manager_id#56, c_first_name#58, c_last_name#59, ca_state#63]
Keys [10]: [c_last_name#59, c_first_name#58, s_store_name#47, ca_state#63, s_state#49, i_color#54, i_current_price#52, i_manager_id#56, i_units#55, i_size#53]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#44))]
Aggregate Attributes [1]: [sum#66]
Results [11]: [c_last_name#59, c_first_name#58, s_store_name#47, ca_state#63, s_state#49, i_color#54, i_current_price#52, i_manager_id#56, i_units#55, i_size#53, sum#67]

(92) Exchange
Input [11]: [c_last_name#59, c_first_name#58, s_store_name#47, ca_state#63, s_state#49, i_color#54, i_current_price#52, i_manager_id#56, i_units#55, i_size#53, sum#67]
Arguments: hashpartitioning(c_last_name#59, c_first_name#58, s_store_name#47, ca_state#63, s_state#49, i_color#54, i_current_price#52, i_manager_id#56, i_units#55, i_size#53, 5), ENSURE_REQUIREMENTS, [plan_id=19]

(93) HashAggregate [codegen id : 19]
Input [11]: [c_last_name#59, c_first_name#58, s_store_name#47, ca_state#63, s_state#49, i_color#54, i_current_price#52, i_manager_id#56, i_units#55, i_size#53, sum#67]
Keys [10]: [c_last_name#59, c_first_name#58, s_store_name#47, ca_state#63, s_state#49, i_color#54, i_current_price#52, i_manager_id#56, i_units#55, i_size#53]
Functions [1]: [sum(UnscaledValue(ss_net_paid#44))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#44))#31]
Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#44))#31,17,2) AS netpaid#68]

(94) HashAggregate [codegen id : 19]
Input [1]: [netpaid#68]
Keys: []
Functions [1]: [partial_avg(netpaid#68)]
Aggregate Attributes [2]: [sum#69, count#70]
Results [2]: [sum#71, count#72]

(95) Exchange
Input [2]: [sum#71, count#72]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=20]

(96) HashAggregate [codegen id : 20]
Input [2]: [sum#71, count#72]
Keys: []
Functions [1]: [avg(netpaid#68)]
Aggregate Attributes [1]: [avg(netpaid#68)#73]
Results [1]: [(0.05 * avg(netpaid#68)#73) AS (0.05 * avg(netpaid))#74]

Subquery:2 Hosting operator id = 3 Hosting Expression = Subquery scalar-subquery#7, [id=#1]
ObjectHashAggregate (103)
+- Exchange (102)
   +- ObjectHashAggregate (101)
      +- * Project (100)
         +- * Filter (99)
            +- * ColumnarToRow (98)
               +- Scan parquet spark_catalog.default.store (97)


(97) Scan parquet spark_catalog.default.store
Output [3]: [s_store_sk#21, s_market_id#23, s_zip#25]
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_market_id:int,s_zip:string>

(98) ColumnarToRow [codegen id : 1]
Input [3]: [s_store_sk#21, s_market_id#23, s_zip#25]

(99) Filter [codegen id : 1]
Input [3]: [s_store_sk#21, s_market_id#23, s_zip#25]
Condition : (((isnotnull(s_market_id#23) AND (s_market_id#23 = 8)) AND isnotnull(s_store_sk#21)) AND isnotnull(s_zip#25))

(100) Project [codegen id : 1]
Output [1]: [s_store_sk#21]
Input [3]: [s_store_sk#21, s_market_id#23, s_zip#25]

(101) ObjectHashAggregate
Input [1]: [s_store_sk#21]
Keys: []
Functions [1]: [partial_bloom_filter_agg(xxhash64(s_store_sk#21, 42), 40, 1250, 0, 0)]
Aggregate Attributes [1]: [buf#75]
Results [1]: [buf#76]

(102) Exchange
Input [1]: [buf#76]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=21]

(103) ObjectHashAggregate
Input [1]: [buf#76]
Keys: []
Functions [1]: [bloom_filter_agg(xxhash64(s_store_sk#21, 42), 40, 1250, 0, 0)]
Aggregate Attributes [1]: [bloom_filter_agg(xxhash64(s_store_sk#21, 42), 40, 1250, 0, 0)#77]
Results [1]: [bloom_filter_agg(xxhash64(s_store_sk#21, 42), 40, 1250, 0, 0)#77 AS bloomFilter#78]


