== Physical Plan ==
TakeOrderedAndProject (160)
+- Union (159)
   :- * HashAggregate (51)
   :  +- Exchange (50)
   :     +- * HashAggregate (49)
   :        +- * Project (48)
   :           +- * SortMergeJoin Inner (47)
   :              :- * Sort (25)
   :              :  +- Exchange (24)
   :              :     +- * Project (23)
   :              :        +- * BroadcastHashJoin Inner BuildRight (22)
   :              :           :- * Project (17)
   :              :           :  +- * BroadcastHashJoin Inner BuildRight (16)
   :              :           :     :- * Project (10)
   :              :           :     :  +- * BroadcastHashJoin Inner BuildRight (9)
   :              :           :     :     :- * Filter (3)
   :              :           :     :     :  +- * ColumnarToRow (2)
   :              :           :     :     :     +- Scan parquet default.catalog_sales (1)
   :              :           :     :     +- BroadcastExchange (8)
   :              :           :     :        +- * Project (7)
   :              :           :     :           +- * Filter (6)
   :              :           :     :              +- * ColumnarToRow (5)
   :              :           :     :                 +- Scan parquet default.customer_demographics (4)
   :              :           :     +- BroadcastExchange (15)
   :              :           :        +- * Project (14)
   :              :           :           +- * Filter (13)
   :              :           :              +- * ColumnarToRow (12)
   :              :           :                 +- Scan parquet default.date_dim (11)
   :              :           +- BroadcastExchange (21)
   :              :              +- * Filter (20)
   :              :                 +- * ColumnarToRow (19)
   :              :                    +- Scan parquet default.item (18)
   :              +- * Sort (46)
   :                 +- Exchange (45)
   :                    +- * Project (44)
   :                       +- * SortMergeJoin Inner (43)
   :                          :- * Sort (37)
   :                          :  +- Exchange (36)
   :                          :     +- * Project (35)
   :                          :        +- * BroadcastHashJoin Inner BuildRight (34)
   :                          :           :- * Project (29)
   :                          :           :  +- * Filter (28)
   :                          :           :     +- * ColumnarToRow (27)
   :                          :           :        +- Scan parquet default.customer (26)
   :                          :           +- BroadcastExchange (33)
   :                          :              +- * Filter (32)
   :                          :                 +- * ColumnarToRow (31)
   :                          :                    +- Scan parquet default.customer_address (30)
   :                          +- * Sort (42)
   :                             +- Exchange (41)
   :                                +- * Filter (40)
   :                                   +- * ColumnarToRow (39)
   :                                      +- Scan parquet default.customer_demographics (38)
   :- * HashAggregate (76)
   :  +- Exchange (75)
   :     +- * HashAggregate (74)
   :        +- * Project (73)
   :           +- * SortMergeJoin Inner (72)
   :              :- * Sort (53)
   :              :  +- ReusedExchange (52)
   :              +- * Sort (71)
   :                 +- Exchange (70)
   :                    +- * Project (69)
   :                       +- * SortMergeJoin Inner (68)
   :                          :- * Sort (65)
   :                          :  +- Exchange (64)
   :                          :     +- * Project (63)
   :                          :        +- * BroadcastHashJoin Inner BuildRight (62)
   :                          :           :- * Project (57)
   :                          :           :  +- * Filter (56)
   :                          :           :     +- * ColumnarToRow (55)
   :                          :           :        +- Scan parquet default.customer (54)
   :                          :           +- BroadcastExchange (61)
   :                          :              +- * Filter (60)
   :                          :                 +- * ColumnarToRow (59)
   :                          :                    +- Scan parquet default.customer_address (58)
   :                          +- * Sort (67)
   :                             +- ReusedExchange (66)
   :- * HashAggregate (102)
   :  +- Exchange (101)
   :     +- * HashAggregate (100)
   :        +- * Project (99)
   :           +- * SortMergeJoin Inner (98)
   :              :- * Sort (78)
   :              :  +- ReusedExchange (77)
   :              +- * Sort (97)
   :                 +- Exchange (96)
   :                    +- * Project (95)
   :                       +- * SortMergeJoin Inner (94)
   :                          :- * Sort (91)
   :                          :  +- Exchange (90)
   :                          :     +- * Project (89)
   :                          :        +- * BroadcastHashJoin Inner BuildRight (88)
   :                          :           :- * Project (82)
   :                          :           :  +- * Filter (81)
   :                          :           :     +- * ColumnarToRow (80)
   :                          :           :        +- Scan parquet default.customer (79)
   :                          :           +- BroadcastExchange (87)
   :                          :              +- * Project (86)
   :                          :                 +- * Filter (85)
   :                          :                    +- * ColumnarToRow (84)
   :                          :                       +- Scan parquet default.customer_address (83)
   :                          +- * Sort (93)
   :                             +- ReusedExchange (92)
   :- * HashAggregate (137)
   :  +- Exchange (136)
   :     +- * HashAggregate (135)
   :        +- * Project (134)
   :           +- * BroadcastHashJoin Inner BuildRight (133)
   :              :- * Project (131)
   :              :  +- * BroadcastHashJoin Inner BuildRight (130)
   :              :     :- * Project (111)
   :              :     :  +- * BroadcastHashJoin Inner BuildRight (110)
   :              :     :     :- * Project (108)
   :              :     :     :  +- * BroadcastHashJoin Inner BuildRight (107)
   :              :     :     :     :- * Filter (105)
   :              :     :     :     :  +- * ColumnarToRow (104)
   :              :     :     :     :     +- Scan parquet default.catalog_sales (103)
   :              :     :     :     +- ReusedExchange (106)
   :              :     :     +- ReusedExchange (109)
   :              :     +- BroadcastExchange (129)
   :              :        +- * Project (128)
   :              :           +- * BroadcastHashJoin Inner BuildLeft (127)
   :              :              :- BroadcastExchange (123)
   :              :              :  +- * Project (122)
   :              :              :     +- * BroadcastHashJoin Inner BuildRight (121)
   :              :              :        :- * Project (115)
   :              :              :        :  +- * Filter (114)
   :              :              :        :     +- * ColumnarToRow (113)
   :              :              :        :        +- Scan parquet default.customer (112)
   :              :              :        +- BroadcastExchange (120)
   :              :              :           +- * Project (119)
   :              :              :              +- * Filter (118)
   :              :              :                 +- * ColumnarToRow (117)
   :              :              :                    +- Scan parquet default.customer_address (116)
   :              :              +- * Filter (126)
   :              :                 +- * ColumnarToRow (125)
   :              :                    +- Scan parquet default.customer_demographics (124)
   :              +- ReusedExchange (132)
   +- * HashAggregate (158)
      +- Exchange (157)
         +- * HashAggregate (156)
            +- * Project (155)
               +- * BroadcastHashJoin Inner BuildRight (154)
                  :- * Project (152)
                  :  +- * BroadcastHashJoin Inner BuildRight (151)
                  :     :- * Project (146)
                  :     :  +- * BroadcastHashJoin Inner BuildRight (145)
                  :     :     :- * Project (143)
                  :     :     :  +- * BroadcastHashJoin Inner BuildRight (142)
                  :     :     :     :- * Filter (140)
                  :     :     :     :  +- * ColumnarToRow (139)
                  :     :     :     :     +- Scan parquet default.catalog_sales (138)
                  :     :     :     +- ReusedExchange (141)
                  :     :     +- ReusedExchange (144)
                  :     +- BroadcastExchange (150)
                  :        +- * Filter (149)
                  :           +- * ColumnarToRow (148)
                  :              +- Scan parquet default.item (147)
                  +- ReusedExchange (153)


(1) Scan parquet default.catalog_sales
Output [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#9), dynamicpruningexpression(cs_sold_date_sk#9 IN dynamicpruning#10)]
PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)]
ReadSchema: struct<cs_bill_customer_sk:int,cs_bill_cdemo_sk:int,cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2),cs_sales_price:decimal(7,2),cs_coupon_amt:decimal(7,2),cs_net_profit:decimal(7,2)>

(2) ColumnarToRow [codegen id : 4]
Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9]

(3) Filter [codegen id : 4]
Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9]
Condition : ((isnotnull(cs_bill_cdemo_sk#2) AND isnotnull(cs_bill_customer_sk#1)) AND isnotnull(cs_item_sk#3))

(4) Scan parquet default.customer_demographics
Output [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_demographics]
PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_education_status,College             ), IsNotNull(cd_demo_sk)]
ReadSchema: struct<cd_demo_sk:int,cd_gender:string,cd_education_status:string,cd_dep_count:int>

(5) ColumnarToRow [codegen id : 1]
Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14]

(6) Filter [codegen id : 1]
Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14]
Condition : ((((isnotnull(cd_gender#12) AND isnotnull(cd_education_status#13)) AND (cd_gender#12 = M)) AND (cd_education_status#13 = College             )) AND isnotnull(cd_demo_sk#11))

(7) Project [codegen id : 1]
Output [2]: [cd_demo_sk#11, cd_dep_count#14]
Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14]

(8) BroadcastExchange
Input [2]: [cd_demo_sk#11, cd_dep_count#14]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15]

(9) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [cs_bill_cdemo_sk#2]
Right keys [1]: [cd_demo_sk#11]
Join condition: None

(10) Project [codegen id : 4]
Output [9]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14]
Input [11]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_demo_sk#11, cd_dep_count#14]

(11) Scan parquet default.date_dim
Output [2]: [d_date_sk#16, d_year#17]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(12) ColumnarToRow [codegen id : 2]
Input [2]: [d_date_sk#16, d_year#17]

(13) Filter [codegen id : 2]
Input [2]: [d_date_sk#16, d_year#17]
Condition : ((isnotnull(d_year#17) AND (d_year#17 = 2001)) AND isnotnull(d_date_sk#16))

(14) Project [codegen id : 2]
Output [1]: [d_date_sk#16]
Input [2]: [d_date_sk#16, d_year#17]

(15) BroadcastExchange
Input [1]: [d_date_sk#16]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18]

(16) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#16]
Join condition: None

(17) Project [codegen id : 4]
Output [8]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14]
Input [10]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, d_date_sk#16]

(18) Scan parquet default.item
Output [2]: [i_item_sk#19, i_item_id#20]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_item_id:string>

(19) ColumnarToRow [codegen id : 3]
Input [2]: [i_item_sk#19, i_item_id#20]

(20) Filter [codegen id : 3]
Input [2]: [i_item_sk#19, i_item_id#20]
Condition : isnotnull(i_item_sk#19)

(21) BroadcastExchange
Input [2]: [i_item_sk#19, i_item_id#20]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21]

(22) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [i_item_sk#19]
Join condition: None

(23) Project [codegen id : 4]
Output [8]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20]
Input [10]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_sk#19, i_item_id#20]

(24) Exchange
Input [8]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20]
Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#22]

(25) Sort [codegen id : 5]
Input [8]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20]
Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0

(26) Scan parquet default.customer
Output [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)]
ReadSchema: struct<c_customer_sk:int,c_current_cdemo_sk:int,c_current_addr_sk:int,c_birth_month:int,c_birth_year:int>

(27) ColumnarToRow [codegen id : 7]
Input [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27]

(28) Filter [codegen id : 7]
Input [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27]
Condition : (((c_birth_month#26 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#23)) AND isnotnull(c_current_cdemo_sk#24)) AND isnotnull(c_current_addr_sk#25))

(29) Project [codegen id : 7]
Output [4]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_year#27]
Input [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27]

(30) Scan parquet default.customer_address
Output [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_county:string,ca_state:string,ca_country:string>

(31) ColumnarToRow [codegen id : 6]
Input [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31]

(32) Filter [codegen id : 6]
Input [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31]
Condition : (ca_state#30 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#28))

(33) BroadcastExchange
Input [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32]

(34) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [c_current_addr_sk#25]
Right keys [1]: [ca_address_sk#28]
Join condition: None

(35) Project [codegen id : 7]
Output [6]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31]
Input [8]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_year#27, ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31]

(36) Exchange
Input [6]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31]
Arguments: hashpartitioning(c_current_cdemo_sk#24, 5), ENSURE_REQUIREMENTS, [id=#33]

(37) Sort [codegen id : 8]
Input [6]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31]
Arguments: [c_current_cdemo_sk#24 ASC NULLS FIRST], false, 0

(38) Scan parquet default.customer_demographics
Output [1]: [cd_demo_sk#34]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_demographics]
PushedFilters: [IsNotNull(cd_demo_sk)]
ReadSchema: struct<cd_demo_sk:int>

(39) ColumnarToRow [codegen id : 9]
Input [1]: [cd_demo_sk#34]

(40) Filter [codegen id : 9]
Input [1]: [cd_demo_sk#34]
Condition : isnotnull(cd_demo_sk#34)

(41) Exchange
Input [1]: [cd_demo_sk#34]
Arguments: hashpartitioning(cd_demo_sk#34, 5), ENSURE_REQUIREMENTS, [id=#35]

(42) Sort [codegen id : 10]
Input [1]: [cd_demo_sk#34]
Arguments: [cd_demo_sk#34 ASC NULLS FIRST], false, 0

(43) SortMergeJoin [codegen id : 11]
Left keys [1]: [c_current_cdemo_sk#24]
Right keys [1]: [cd_demo_sk#34]
Join condition: None

(44) Project [codegen id : 11]
Output [5]: [c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31]
Input [7]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31, cd_demo_sk#34]

(45) Exchange
Input [5]: [c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31]
Arguments: hashpartitioning(c_customer_sk#23, 5), ENSURE_REQUIREMENTS, [id=#36]

(46) Sort [codegen id : 12]
Input [5]: [c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31]
Arguments: [c_customer_sk#23 ASC NULLS FIRST], false, 0

(47) SortMergeJoin [codegen id : 13]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#23]
Join condition: None

(48) Project [codegen id : 13]
Output [11]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, cast(cs_quantity#4 as decimal(12,2)) AS agg1#37, cast(cs_list_price#5 as decimal(12,2)) AS agg2#38, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#39, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#40, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#41, cast(c_birth_year#27 as decimal(12,2)) AS agg6#42, cast(cd_dep_count#14 as decimal(12,2)) AS agg7#43]
Input [13]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20, c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31]

(49) HashAggregate [codegen id : 13]
Input [11]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, agg1#37, agg2#38, agg3#39, agg4#40, agg5#41, agg6#42, agg7#43]
Keys [4]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29]
Functions [7]: [partial_avg(agg1#37), partial_avg(agg2#38), partial_avg(agg3#39), partial_avg(agg4#40), partial_avg(agg5#41), partial_avg(agg6#42), partial_avg(agg7#43)]
Aggregate Attributes [14]: [sum#44, count#45, sum#46, count#47, sum#48, count#49, sum#50, count#51, sum#52, count#53, sum#54, count#55, sum#56, count#57]
Results [18]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69, sum#70, count#71]

(50) Exchange
Input [18]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69, sum#70, count#71]
Arguments: hashpartitioning(i_item_id#20, ca_country#31, ca_state#30, ca_county#29, 5), ENSURE_REQUIREMENTS, [id=#72]

(51) HashAggregate [codegen id : 14]
Input [18]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69, sum#70, count#71]
Keys [4]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29]
Functions [7]: [avg(agg1#37), avg(agg2#38), avg(agg3#39), avg(agg4#40), avg(agg5#41), avg(agg6#42), avg(agg7#43)]
Aggregate Attributes [7]: [avg(agg1#37)#73, avg(agg2#38)#74, avg(agg3#39)#75, avg(agg4#40)#76, avg(agg5#41)#77, avg(agg6#42)#78, avg(agg7#43)#79]
Results [11]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, avg(agg1#37)#73 AS agg1#80, avg(agg2#38)#74 AS agg2#81, avg(agg3#39)#75 AS agg3#82, avg(agg4#40)#76 AS agg4#83, avg(agg5#41)#77 AS agg5#84, avg(agg6#42)#78 AS agg6#85, avg(agg7#43)#79 AS agg7#86]

(52) ReusedExchange [Reuses operator id: unknown]
Output [8]: [cs_bill_customer_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cd_dep_count#93, i_item_id#94]

(53) Sort [codegen id : 19]
Input [8]: [cs_bill_customer_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cd_dep_count#93, i_item_id#94]
Arguments: [cs_bill_customer_sk#87 ASC NULLS FIRST], false, 0

(54) Scan parquet default.customer
Output [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_month#98, c_birth_year#99]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)]
ReadSchema: struct<c_customer_sk:int,c_current_cdemo_sk:int,c_current_addr_sk:int,c_birth_month:int,c_birth_year:int>

(55) ColumnarToRow [codegen id : 21]
Input [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_month#98, c_birth_year#99]

(56) Filter [codegen id : 21]
Input [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_month#98, c_birth_year#99]
Condition : (((c_birth_month#98 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#95)) AND isnotnull(c_current_cdemo_sk#96)) AND isnotnull(c_current_addr_sk#97))

(57) Project [codegen id : 21]
Output [4]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_year#99]
Input [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_month#98, c_birth_year#99]

(58) Scan parquet default.customer_address
Output [3]: [ca_address_sk#100, ca_state#101, ca_country#102]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string,ca_country:string>

(59) ColumnarToRow [codegen id : 20]
Input [3]: [ca_address_sk#100, ca_state#101, ca_country#102]

(60) Filter [codegen id : 20]
Input [3]: [ca_address_sk#100, ca_state#101, ca_country#102]
Condition : (ca_state#101 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#100))

(61) BroadcastExchange
Input [3]: [ca_address_sk#100, ca_state#101, ca_country#102]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#103]

(62) BroadcastHashJoin [codegen id : 21]
Left keys [1]: [c_current_addr_sk#97]
Right keys [1]: [ca_address_sk#100]
Join condition: None

(63) Project [codegen id : 21]
Output [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_birth_year#99, ca_state#101, ca_country#102]
Input [7]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_year#99, ca_address_sk#100, ca_state#101, ca_country#102]

(64) Exchange
Input [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_birth_year#99, ca_state#101, ca_country#102]
Arguments: hashpartitioning(c_current_cdemo_sk#96, 5), ENSURE_REQUIREMENTS, [id=#104]

(65) Sort [codegen id : 22]
Input [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_birth_year#99, ca_state#101, ca_country#102]
Arguments: [c_current_cdemo_sk#96 ASC NULLS FIRST], false, 0

(66) ReusedExchange [Reuses operator id: 41]
Output [1]: [cd_demo_sk#105]

(67) Sort [codegen id : 24]
Input [1]: [cd_demo_sk#105]
Arguments: [cd_demo_sk#105 ASC NULLS FIRST], false, 0

(68) SortMergeJoin [codegen id : 25]
Left keys [1]: [c_current_cdemo_sk#96]
Right keys [1]: [cd_demo_sk#105]
Join condition: None

(69) Project [codegen id : 25]
Output [4]: [c_customer_sk#95, c_birth_year#99, ca_state#101, ca_country#102]
Input [6]: [c_customer_sk#95, c_current_cdemo_sk#96, c_birth_year#99, ca_state#101, ca_country#102, cd_demo_sk#105]

(70) Exchange
Input [4]: [c_customer_sk#95, c_birth_year#99, ca_state#101, ca_country#102]
Arguments: hashpartitioning(c_customer_sk#95, 5), ENSURE_REQUIREMENTS, [id=#106]

(71) Sort [codegen id : 26]
Input [4]: [c_customer_sk#95, c_birth_year#99, ca_state#101, ca_country#102]
Arguments: [c_customer_sk#95 ASC NULLS FIRST], false, 0

(72) SortMergeJoin [codegen id : 27]
Left keys [1]: [cs_bill_customer_sk#87]
Right keys [1]: [c_customer_sk#95]
Join condition: None

(73) Project [codegen id : 27]
Output [10]: [i_item_id#94, ca_country#102, ca_state#101, cast(cs_quantity#88 as decimal(12,2)) AS agg1#37, cast(cs_list_price#89 as decimal(12,2)) AS agg2#38, cast(cs_coupon_amt#91 as decimal(12,2)) AS agg3#39, cast(cs_sales_price#90 as decimal(12,2)) AS agg4#40, cast(cs_net_profit#92 as decimal(12,2)) AS agg5#41, cast(c_birth_year#99 as decimal(12,2)) AS agg6#42, cast(cd_dep_count#93 as decimal(12,2)) AS agg7#43]
Input [12]: [cs_bill_customer_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cd_dep_count#93, i_item_id#94, c_customer_sk#95, c_birth_year#99, ca_state#101, ca_country#102]

(74) HashAggregate [codegen id : 27]
Input [10]: [i_item_id#94, ca_country#102, ca_state#101, agg1#37, agg2#38, agg3#39, agg4#40, agg5#41, agg6#42, agg7#43]
Keys [3]: [i_item_id#94, ca_country#102, ca_state#101]
Functions [7]: [partial_avg(agg1#37), partial_avg(agg2#38), partial_avg(agg3#39), partial_avg(agg4#40), partial_avg(agg5#41), partial_avg(agg6#42), partial_avg(agg7#43)]
Aggregate Attributes [14]: [sum#107, count#108, sum#109, count#110, sum#111, count#112, sum#113, count#114, sum#115, count#116, sum#117, count#118, sum#119, count#120]
Results [17]: [i_item_id#94, ca_country#102, ca_state#101, sum#121, count#122, sum#123, count#124, sum#125, count#126, sum#127, count#128, sum#129, count#130, sum#131, count#132, sum#133, count#134]

(75) Exchange
Input [17]: [i_item_id#94, ca_country#102, ca_state#101, sum#121, count#122, sum#123, count#124, sum#125, count#126, sum#127, count#128, sum#129, count#130, sum#131, count#132, sum#133, count#134]
Arguments: hashpartitioning(i_item_id#94, ca_country#102, ca_state#101, 5), ENSURE_REQUIREMENTS, [id=#135]

(76) HashAggregate [codegen id : 28]
Input [17]: [i_item_id#94, ca_country#102, ca_state#101, sum#121, count#122, sum#123, count#124, sum#125, count#126, sum#127, count#128, sum#129, count#130, sum#131, count#132, sum#133, count#134]
Keys [3]: [i_item_id#94, ca_country#102, ca_state#101]
Functions [7]: [avg(agg1#37), avg(agg2#38), avg(agg3#39), avg(agg4#40), avg(agg5#41), avg(agg6#42), avg(agg7#43)]
Aggregate Attributes [7]: [avg(agg1#37)#136, avg(agg2#38)#137, avg(agg3#39)#138, avg(agg4#40)#139, avg(agg5#41)#140, avg(agg6#42)#141, avg(agg7#43)#142]
Results [11]: [i_item_id#94, ca_country#102, ca_state#101, null AS county#143, avg(agg1#37)#136 AS agg1#144, avg(agg2#38)#137 AS agg2#145, avg(agg3#39)#138 AS agg3#146, avg(agg4#40)#139 AS agg4#147, avg(agg5#41)#140 AS agg5#148, avg(agg6#42)#141 AS agg6#149, avg(agg7#43)#142 AS agg7#150]

(77) ReusedExchange [Reuses operator id: unknown]
Output [8]: [cs_bill_customer_sk#151, cs_quantity#152, cs_list_price#153, cs_sales_price#154, cs_coupon_amt#155, cs_net_profit#156, cd_dep_count#157, i_item_id#158]

(78) Sort [codegen id : 33]
Input [8]: [cs_bill_customer_sk#151, cs_quantity#152, cs_list_price#153, cs_sales_price#154, cs_coupon_amt#155, cs_net_profit#156, cd_dep_count#157, i_item_id#158]
Arguments: [cs_bill_customer_sk#151 ASC NULLS FIRST], false, 0

(79) Scan parquet default.customer
Output [5]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_month#162, c_birth_year#163]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)]
ReadSchema: struct<c_customer_sk:int,c_current_cdemo_sk:int,c_current_addr_sk:int,c_birth_month:int,c_birth_year:int>

(80) ColumnarToRow [codegen id : 35]
Input [5]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_month#162, c_birth_year#163]

(81) Filter [codegen id : 35]
Input [5]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_month#162, c_birth_year#163]
Condition : (((c_birth_month#162 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#159)) AND isnotnull(c_current_cdemo_sk#160)) AND isnotnull(c_current_addr_sk#161))

(82) Project [codegen id : 35]
Output [4]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_year#163]
Input [5]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_month#162, c_birth_year#163]

(83) Scan parquet default.customer_address
Output [3]: [ca_address_sk#164, ca_state#165, ca_country#166]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string,ca_country:string>

(84) ColumnarToRow [codegen id : 34]
Input [3]: [ca_address_sk#164, ca_state#165, ca_country#166]

(85) Filter [codegen id : 34]
Input [3]: [ca_address_sk#164, ca_state#165, ca_country#166]
Condition : (ca_state#165 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#164))

(86) Project [codegen id : 34]
Output [2]: [ca_address_sk#164, ca_country#166]
Input [3]: [ca_address_sk#164, ca_state#165, ca_country#166]

(87) BroadcastExchange
Input [2]: [ca_address_sk#164, ca_country#166]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#167]

(88) BroadcastHashJoin [codegen id : 35]
Left keys [1]: [c_current_addr_sk#161]
Right keys [1]: [ca_address_sk#164]
Join condition: None

(89) Project [codegen id : 35]
Output [4]: [c_customer_sk#159, c_current_cdemo_sk#160, c_birth_year#163, ca_country#166]
Input [6]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_year#163, ca_address_sk#164, ca_country#166]

(90) Exchange
Input [4]: [c_customer_sk#159, c_current_cdemo_sk#160, c_birth_year#163, ca_country#166]
Arguments: hashpartitioning(c_current_cdemo_sk#160, 5), ENSURE_REQUIREMENTS, [id=#168]

(91) Sort [codegen id : 36]
Input [4]: [c_customer_sk#159, c_current_cdemo_sk#160, c_birth_year#163, ca_country#166]
Arguments: [c_current_cdemo_sk#160 ASC NULLS FIRST], false, 0

(92) ReusedExchange [Reuses operator id: 41]
Output [1]: [cd_demo_sk#169]

(93) Sort [codegen id : 38]
Input [1]: [cd_demo_sk#169]
Arguments: [cd_demo_sk#169 ASC NULLS FIRST], false, 0

(94) SortMergeJoin [codegen id : 39]
Left keys [1]: [c_current_cdemo_sk#160]
Right keys [1]: [cd_demo_sk#169]
Join condition: None

(95) Project [codegen id : 39]
Output [3]: [c_customer_sk#159, c_birth_year#163, ca_country#166]
Input [5]: [c_customer_sk#159, c_current_cdemo_sk#160, c_birth_year#163, ca_country#166, cd_demo_sk#169]

(96) Exchange
Input [3]: [c_customer_sk#159, c_birth_year#163, ca_country#166]
Arguments: hashpartitioning(c_customer_sk#159, 5), ENSURE_REQUIREMENTS, [id=#170]

(97) Sort [codegen id : 40]
Input [3]: [c_customer_sk#159, c_birth_year#163, ca_country#166]
Arguments: [c_customer_sk#159 ASC NULLS FIRST], false, 0

(98) SortMergeJoin [codegen id : 41]
Left keys [1]: [cs_bill_customer_sk#151]
Right keys [1]: [c_customer_sk#159]
Join condition: None

(99) Project [codegen id : 41]
Output [9]: [i_item_id#158, ca_country#166, cast(cs_quantity#152 as decimal(12,2)) AS agg1#37, cast(cs_list_price#153 as decimal(12,2)) AS agg2#38, cast(cs_coupon_amt#155 as decimal(12,2)) AS agg3#39, cast(cs_sales_price#154 as decimal(12,2)) AS agg4#40, cast(cs_net_profit#156 as decimal(12,2)) AS agg5#41, cast(c_birth_year#163 as decimal(12,2)) AS agg6#42, cast(cd_dep_count#157 as decimal(12,2)) AS agg7#43]
Input [11]: [cs_bill_customer_sk#151, cs_quantity#152, cs_list_price#153, cs_sales_price#154, cs_coupon_amt#155, cs_net_profit#156, cd_dep_count#157, i_item_id#158, c_customer_sk#159, c_birth_year#163, ca_country#166]

(100) HashAggregate [codegen id : 41]
Input [9]: [i_item_id#158, ca_country#166, agg1#37, agg2#38, agg3#39, agg4#40, agg5#41, agg6#42, agg7#43]
Keys [2]: [i_item_id#158, ca_country#166]
Functions [7]: [partial_avg(agg1#37), partial_avg(agg2#38), partial_avg(agg3#39), partial_avg(agg4#40), partial_avg(agg5#41), partial_avg(agg6#42), partial_avg(agg7#43)]
Aggregate Attributes [14]: [sum#171, count#172, sum#173, count#174, sum#175, count#176, sum#177, count#178, sum#179, count#180, sum#181, count#182, sum#183, count#184]
Results [16]: [i_item_id#158, ca_country#166, sum#185, count#186, sum#187, count#188, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198]

(101) Exchange
Input [16]: [i_item_id#158, ca_country#166, sum#185, count#186, sum#187, count#188, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198]
Arguments: hashpartitioning(i_item_id#158, ca_country#166, 5), ENSURE_REQUIREMENTS, [id=#199]

(102) HashAggregate [codegen id : 42]
Input [16]: [i_item_id#158, ca_country#166, sum#185, count#186, sum#187, count#188, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198]
Keys [2]: [i_item_id#158, ca_country#166]
Functions [7]: [avg(agg1#37), avg(agg2#38), avg(agg3#39), avg(agg4#40), avg(agg5#41), avg(agg6#42), avg(agg7#43)]
Aggregate Attributes [7]: [avg(agg1#37)#200, avg(agg2#38)#201, avg(agg3#39)#202, avg(agg4#40)#203, avg(agg5#41)#204, avg(agg6#42)#205, avg(agg7#43)#206]
Results [11]: [i_item_id#158, ca_country#166, null AS ca_state#207, null AS county#208, avg(agg1#37)#200 AS agg1#209, avg(agg2#38)#201 AS agg2#210, avg(agg3#39)#202 AS agg3#211, avg(agg4#40)#203 AS agg4#212, avg(agg5#41)#204 AS agg5#213, avg(agg6#42)#205 AS agg6#214, avg(agg7#43)#206 AS agg7#215]

(103) Scan parquet default.catalog_sales
Output [9]: [cs_bill_customer_sk#216, cs_bill_cdemo_sk#217, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#224), dynamicpruningexpression(cs_sold_date_sk#224 IN dynamicpruning#10)]
PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)]
ReadSchema: struct<cs_bill_customer_sk:int,cs_bill_cdemo_sk:int,cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2),cs_sales_price:decimal(7,2),cs_coupon_amt:decimal(7,2),cs_net_profit:decimal(7,2)>

(104) ColumnarToRow [codegen id : 49]
Input [9]: [cs_bill_customer_sk#216, cs_bill_cdemo_sk#217, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224]

(105) Filter [codegen id : 49]
Input [9]: [cs_bill_customer_sk#216, cs_bill_cdemo_sk#217, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224]
Condition : ((isnotnull(cs_bill_cdemo_sk#217) AND isnotnull(cs_bill_customer_sk#216)) AND isnotnull(cs_item_sk#218))

(106) ReusedExchange [Reuses operator id: 8]
Output [2]: [cd_demo_sk#225, cd_dep_count#226]

(107) BroadcastHashJoin [codegen id : 49]
Left keys [1]: [cs_bill_cdemo_sk#217]
Right keys [1]: [cd_demo_sk#225]
Join condition: None

(108) Project [codegen id : 49]
Output [9]: [cs_bill_customer_sk#216, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224, cd_dep_count#226]
Input [11]: [cs_bill_customer_sk#216, cs_bill_cdemo_sk#217, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224, cd_demo_sk#225, cd_dep_count#226]

(109) ReusedExchange [Reuses operator id: 15]
Output [1]: [d_date_sk#227]

(110) BroadcastHashJoin [codegen id : 49]
Left keys [1]: [cs_sold_date_sk#224]
Right keys [1]: [d_date_sk#227]
Join condition: None

(111) Project [codegen id : 49]
Output [8]: [cs_bill_customer_sk#216, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cd_dep_count#226]
Input [10]: [cs_bill_customer_sk#216, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224, cd_dep_count#226, d_date_sk#227]

(112) Scan parquet default.customer
Output [5]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_month#231, c_birth_year#232]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)]
ReadSchema: struct<c_customer_sk:int,c_current_cdemo_sk:int,c_current_addr_sk:int,c_birth_month:int,c_birth_year:int>

(113) ColumnarToRow [codegen id : 46]
Input [5]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_month#231, c_birth_year#232]

(114) Filter [codegen id : 46]
Input [5]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_month#231, c_birth_year#232]
Condition : (((c_birth_month#231 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#228)) AND isnotnull(c_current_cdemo_sk#229)) AND isnotnull(c_current_addr_sk#230))

(115) Project [codegen id : 46]
Output [4]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_year#232]
Input [5]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_month#231, c_birth_year#232]

(116) Scan parquet default.customer_address
Output [2]: [ca_address_sk#233, ca_state#234]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string>

(117) ColumnarToRow [codegen id : 45]
Input [2]: [ca_address_sk#233, ca_state#234]

(118) Filter [codegen id : 45]
Input [2]: [ca_address_sk#233, ca_state#234]
Condition : (ca_state#234 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#233))

(119) Project [codegen id : 45]
Output [1]: [ca_address_sk#233]
Input [2]: [ca_address_sk#233, ca_state#234]

(120) BroadcastExchange
Input [1]: [ca_address_sk#233]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#235]

(121) BroadcastHashJoin [codegen id : 46]
Left keys [1]: [c_current_addr_sk#230]
Right keys [1]: [ca_address_sk#233]
Join condition: None

(122) Project [codegen id : 46]
Output [3]: [c_customer_sk#228, c_current_cdemo_sk#229, c_birth_year#232]
Input [5]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_year#232, ca_address_sk#233]

(123) BroadcastExchange
Input [3]: [c_customer_sk#228, c_current_cdemo_sk#229, c_birth_year#232]
Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#236]

(124) Scan parquet default.customer_demographics
Output [1]: [cd_demo_sk#237]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_demographics]
PushedFilters: [IsNotNull(cd_demo_sk)]
ReadSchema: struct<cd_demo_sk:int>

(125) ColumnarToRow
Input [1]: [cd_demo_sk#237]

(126) Filter
Input [1]: [cd_demo_sk#237]
Condition : isnotnull(cd_demo_sk#237)

(127) BroadcastHashJoin [codegen id : 47]
Left keys [1]: [c_current_cdemo_sk#229]
Right keys [1]: [cd_demo_sk#237]
Join condition: None

(128) Project [codegen id : 47]
Output [2]: [c_customer_sk#228, c_birth_year#232]
Input [4]: [c_customer_sk#228, c_current_cdemo_sk#229, c_birth_year#232, cd_demo_sk#237]

(129) BroadcastExchange
Input [2]: [c_customer_sk#228, c_birth_year#232]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#238]

(130) BroadcastHashJoin [codegen id : 49]
Left keys [1]: [cs_bill_customer_sk#216]
Right keys [1]: [c_customer_sk#228]
Join condition: None

(131) Project [codegen id : 49]
Output [8]: [cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cd_dep_count#226, c_birth_year#232]
Input [10]: [cs_bill_customer_sk#216, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cd_dep_count#226, c_customer_sk#228, c_birth_year#232]

(132) ReusedExchange [Reuses operator id: 21]
Output [2]: [i_item_sk#239, i_item_id#240]

(133) BroadcastHashJoin [codegen id : 49]
Left keys [1]: [cs_item_sk#218]
Right keys [1]: [i_item_sk#239]
Join condition: None

(134) Project [codegen id : 49]
Output [8]: [i_item_id#240, cast(cs_quantity#219 as decimal(12,2)) AS agg1#37, cast(cs_list_price#220 as decimal(12,2)) AS agg2#38, cast(cs_coupon_amt#222 as decimal(12,2)) AS agg3#39, cast(cs_sales_price#221 as decimal(12,2)) AS agg4#40, cast(cs_net_profit#223 as decimal(12,2)) AS agg5#41, cast(c_birth_year#232 as decimal(12,2)) AS agg6#42, cast(cd_dep_count#226 as decimal(12,2)) AS agg7#43]
Input [10]: [cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cd_dep_count#226, c_birth_year#232, i_item_sk#239, i_item_id#240]

(135) HashAggregate [codegen id : 49]
Input [8]: [i_item_id#240, agg1#37, agg2#38, agg3#39, agg4#40, agg5#41, agg6#42, agg7#43]
Keys [1]: [i_item_id#240]
Functions [7]: [partial_avg(agg1#37), partial_avg(agg2#38), partial_avg(agg3#39), partial_avg(agg4#40), partial_avg(agg5#41), partial_avg(agg6#42), partial_avg(agg7#43)]
Aggregate Attributes [14]: [sum#241, count#242, sum#243, count#244, sum#245, count#246, sum#247, count#248, sum#249, count#250, sum#251, count#252, sum#253, count#254]
Results [15]: [i_item_id#240, sum#255, count#256, sum#257, count#258, sum#259, count#260, sum#261, count#262, sum#263, count#264, sum#265, count#266, sum#267, count#268]

(136) Exchange
Input [15]: [i_item_id#240, sum#255, count#256, sum#257, count#258, sum#259, count#260, sum#261, count#262, sum#263, count#264, sum#265, count#266, sum#267, count#268]
Arguments: hashpartitioning(i_item_id#240, 5), ENSURE_REQUIREMENTS, [id=#269]

(137) HashAggregate [codegen id : 50]
Input [15]: [i_item_id#240, sum#255, count#256, sum#257, count#258, sum#259, count#260, sum#261, count#262, sum#263, count#264, sum#265, count#266, sum#267, count#268]
Keys [1]: [i_item_id#240]
Functions [7]: [avg(agg1#37), avg(agg2#38), avg(agg3#39), avg(agg4#40), avg(agg5#41), avg(agg6#42), avg(agg7#43)]
Aggregate Attributes [7]: [avg(agg1#37)#270, avg(agg2#38)#271, avg(agg3#39)#272, avg(agg4#40)#273, avg(agg5#41)#274, avg(agg6#42)#275, avg(agg7#43)#276]
Results [11]: [i_item_id#240, null AS ca_country#277, null AS ca_state#278, null AS county#279, avg(agg1#37)#270 AS agg1#280, avg(agg2#38)#271 AS agg2#281, avg(agg3#39)#272 AS agg3#282, avg(agg4#40)#273 AS agg4#283, avg(agg5#41)#274 AS agg5#284, avg(agg6#42)#275 AS agg6#285, avg(agg7#43)#276 AS agg7#286]

(138) Scan parquet default.catalog_sales
Output [9]: [cs_bill_customer_sk#287, cs_bill_cdemo_sk#288, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#295), dynamicpruningexpression(cs_sold_date_sk#295 IN dynamicpruning#10)]
PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)]
ReadSchema: struct<cs_bill_customer_sk:int,cs_bill_cdemo_sk:int,cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2),cs_sales_price:decimal(7,2),cs_coupon_amt:decimal(7,2),cs_net_profit:decimal(7,2)>

(139) ColumnarToRow [codegen id : 57]
Input [9]: [cs_bill_customer_sk#287, cs_bill_cdemo_sk#288, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295]

(140) Filter [codegen id : 57]
Input [9]: [cs_bill_customer_sk#287, cs_bill_cdemo_sk#288, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295]
Condition : ((isnotnull(cs_bill_cdemo_sk#288) AND isnotnull(cs_bill_customer_sk#287)) AND isnotnull(cs_item_sk#289))

(141) ReusedExchange [Reuses operator id: 8]
Output [2]: [cd_demo_sk#296, cd_dep_count#297]

(142) BroadcastHashJoin [codegen id : 57]
Left keys [1]: [cs_bill_cdemo_sk#288]
Right keys [1]: [cd_demo_sk#296]
Join condition: None

(143) Project [codegen id : 57]
Output [9]: [cs_bill_customer_sk#287, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295, cd_dep_count#297]
Input [11]: [cs_bill_customer_sk#287, cs_bill_cdemo_sk#288, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295, cd_demo_sk#296, cd_dep_count#297]

(144) ReusedExchange [Reuses operator id: 15]
Output [1]: [d_date_sk#298]

(145) BroadcastHashJoin [codegen id : 57]
Left keys [1]: [cs_sold_date_sk#295]
Right keys [1]: [d_date_sk#298]
Join condition: None

(146) Project [codegen id : 57]
Output [8]: [cs_bill_customer_sk#287, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cd_dep_count#297]
Input [10]: [cs_bill_customer_sk#287, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295, cd_dep_count#297, d_date_sk#298]

(147) Scan parquet default.item
Output [1]: [i_item_sk#299]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int>

(148) ColumnarToRow [codegen id : 53]
Input [1]: [i_item_sk#299]

(149) Filter [codegen id : 53]
Input [1]: [i_item_sk#299]
Condition : isnotnull(i_item_sk#299)

(150) BroadcastExchange
Input [1]: [i_item_sk#299]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#300]

(151) BroadcastHashJoin [codegen id : 57]
Left keys [1]: [cs_item_sk#289]
Right keys [1]: [i_item_sk#299]
Join condition: None

(152) Project [codegen id : 57]
Output [7]: [cs_bill_customer_sk#287, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cd_dep_count#297]
Input [9]: [cs_bill_customer_sk#287, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cd_dep_count#297, i_item_sk#299]

(153) ReusedExchange [Reuses operator id: 129]
Output [2]: [c_customer_sk#301, c_birth_year#302]

(154) BroadcastHashJoin [codegen id : 57]
Left keys [1]: [cs_bill_customer_sk#287]
Right keys [1]: [c_customer_sk#301]
Join condition: None

(155) Project [codegen id : 57]
Output [7]: [cast(cs_quantity#290 as decimal(12,2)) AS agg1#37, cast(cs_list_price#291 as decimal(12,2)) AS agg2#38, cast(cs_coupon_amt#293 as decimal(12,2)) AS agg3#39, cast(cs_sales_price#292 as decimal(12,2)) AS agg4#40, cast(cs_net_profit#294 as decimal(12,2)) AS agg5#41, cast(c_birth_year#302 as decimal(12,2)) AS agg6#42, cast(cd_dep_count#297 as decimal(12,2)) AS agg7#43]
Input [9]: [cs_bill_customer_sk#287, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cd_dep_count#297, c_customer_sk#301, c_birth_year#302]

(156) HashAggregate [codegen id : 57]
Input [7]: [agg1#37, agg2#38, agg3#39, agg4#40, agg5#41, agg6#42, agg7#43]
Keys: []
Functions [7]: [partial_avg(agg1#37), partial_avg(agg2#38), partial_avg(agg3#39), partial_avg(agg4#40), partial_avg(agg5#41), partial_avg(agg6#42), partial_avg(agg7#43)]
Aggregate Attributes [14]: [sum#303, count#304, sum#305, count#306, sum#307, count#308, sum#309, count#310, sum#311, count#312, sum#313, count#314, sum#315, count#316]
Results [14]: [sum#317, count#318, sum#319, count#320, sum#321, count#322, sum#323, count#324, sum#325, count#326, sum#327, count#328, sum#329, count#330]

(157) Exchange
Input [14]: [sum#317, count#318, sum#319, count#320, sum#321, count#322, sum#323, count#324, sum#325, count#326, sum#327, count#328, sum#329, count#330]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#331]

(158) HashAggregate [codegen id : 58]
Input [14]: [sum#317, count#318, sum#319, count#320, sum#321, count#322, sum#323, count#324, sum#325, count#326, sum#327, count#328, sum#329, count#330]
Keys: []
Functions [7]: [avg(agg1#37), avg(agg2#38), avg(agg3#39), avg(agg4#40), avg(agg5#41), avg(agg6#42), avg(agg7#43)]
Aggregate Attributes [7]: [avg(agg1#37)#332, avg(agg2#38)#333, avg(agg3#39)#334, avg(agg4#40)#335, avg(agg5#41)#336, avg(agg6#42)#337, avg(agg7#43)#338]
Results [11]: [null AS i_item_id#339, null AS ca_country#340, null AS ca_state#341, null AS county#342, avg(agg1#37)#332 AS agg1#343, avg(agg2#38)#333 AS agg2#344, avg(agg3#39)#334 AS agg3#345, avg(agg4#40)#335 AS agg4#346, avg(agg5#41)#336 AS agg5#347, avg(agg6#42)#337 AS agg6#348, avg(agg7#43)#338 AS agg7#349]

(159) Union

(160) TakeOrderedAndProject
Input [11]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, agg1#80, agg2#81, agg3#82, agg4#83, agg5#84, agg6#85, agg7#86]
Arguments: 100, [ca_country#31 ASC NULLS FIRST, ca_state#30 ASC NULLS FIRST, ca_county#29 ASC NULLS FIRST, i_item_id#20 ASC NULLS FIRST], [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, agg1#80, agg2#81, agg3#82, agg4#83, agg5#84, agg6#85, agg7#86]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10
ReusedExchange (161)


(161) ReusedExchange [Reuses operator id: 15]
Output [1]: [d_date_sk#16]

Subquery:2 Hosting operator id = 103 Hosting Expression = cs_sold_date_sk#224 IN dynamicpruning#10

Subquery:3 Hosting operator id = 138 Hosting Expression = cs_sold_date_sk#295 IN dynamicpruning#10


