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


(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 : 7]
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 : 7]
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 : 7]
Left keys [1]: [cs_bill_cdemo_sk#2]
Right keys [1]: [cd_demo_sk#11]
Join condition: None

(10) Project [codegen id : 7]
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.customer
Output [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [In(c_birth_month, [1,10,12,4,5,9]), 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>

(12) ColumnarToRow [codegen id : 2]
Input [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20]

(13) Filter [codegen id : 2]
Input [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20]
Condition : (((c_birth_month#19 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#16)) AND isnotnull(c_current_cdemo_sk#17)) AND isnotnull(c_current_addr_sk#18))

(14) Project [codegen id : 2]
Output [4]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]
Input [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20]

(15) BroadcastExchange
Input [4]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21]

(16) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#16]
Join condition: None

(17) Project [codegen id : 7]
Output [11]: [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, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]
Input [13]: [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, c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]

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

(19) ColumnarToRow [codegen id : 3]
Input [1]: [cd_demo_sk#22]

(20) Filter [codegen id : 3]
Input [1]: [cd_demo_sk#22]
Condition : isnotnull(cd_demo_sk#22)

(21) BroadcastExchange
Input [1]: [cd_demo_sk#22]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23]

(22) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [c_current_cdemo_sk#17]
Right keys [1]: [cd_demo_sk#22]
Join condition: None

(23) Project [codegen id : 7]
Output [10]: [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, c_current_addr_sk#18, c_birth_year#20]
Input [12]: [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, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20, cd_demo_sk#22]

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

(25) ColumnarToRow [codegen id : 4]
Input [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27]

(26) Filter [codegen id : 4]
Input [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27]
Condition : (ca_state#26 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#24))

(27) BroadcastExchange
Input [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#28]

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

(29) Project [codegen id : 7]
Output [12]: [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, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27]
Input [14]: [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, c_current_addr_sk#18, c_birth_year#20, ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27]

(30) ReusedExchange [Reuses operator id: 158]
Output [1]: [d_date_sk#29]

(31) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#29]
Join condition: None

(32) Project [codegen id : 7]
Output [11]: [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, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27]
Input [13]: [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, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27, d_date_sk#29]

(33) Scan parquet default.item
Output [2]: [i_item_sk#30, i_item_id#31]
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>

(34) ColumnarToRow [codegen id : 6]
Input [2]: [i_item_sk#30, i_item_id#31]

(35) Filter [codegen id : 6]
Input [2]: [i_item_sk#30, i_item_id#31]
Condition : isnotnull(i_item_sk#30)

(36) BroadcastExchange
Input [2]: [i_item_sk#30, i_item_id#31]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32]

(37) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [i_item_sk#30]
Join condition: None

(38) Project [codegen id : 7]
Output [11]: [i_item_id#31, ca_country#27, ca_state#26, ca_county#25, cast(cs_quantity#4 as decimal(12,2)) AS agg1#33, cast(cs_list_price#5 as decimal(12,2)) AS agg2#34, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#35, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#36, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#37, cast(c_birth_year#20 as decimal(12,2)) AS agg6#38, cast(cd_dep_count#14 as decimal(12,2)) AS agg7#39]
Input [13]: [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, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27, i_item_sk#30, i_item_id#31]

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

(40) Exchange
Input [18]: [i_item_id#31, ca_country#27, ca_state#26, ca_county#25, sum#54, count#55, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67]
Arguments: hashpartitioning(i_item_id#31, ca_country#27, ca_state#26, ca_county#25, 5), ENSURE_REQUIREMENTS, [id=#68]

(41) HashAggregate [codegen id : 8]
Input [18]: [i_item_id#31, ca_country#27, ca_state#26, ca_county#25, sum#54, count#55, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67]
Keys [4]: [i_item_id#31, ca_country#27, ca_state#26, ca_county#25]
Functions [7]: [avg(agg1#33), avg(agg2#34), avg(agg3#35), avg(agg4#36), avg(agg5#37), avg(agg6#38), avg(agg7#39)]
Aggregate Attributes [7]: [avg(agg1#33)#69, avg(agg2#34)#70, avg(agg3#35)#71, avg(agg4#36)#72, avg(agg5#37)#73, avg(agg6#38)#74, avg(agg7#39)#75]
Results [11]: [i_item_id#31, ca_country#27, ca_state#26, ca_county#25, avg(agg1#33)#69 AS agg1#76, avg(agg2#34)#70 AS agg2#77, avg(agg3#35)#71 AS agg3#78, avg(agg4#36)#72 AS agg4#79, avg(agg5#37)#73 AS agg5#80, avg(agg6#38)#74 AS agg6#81, avg(agg7#39)#75 AS agg7#82]

(42) 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)>

(43) ColumnarToRow [codegen id : 15]
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]

(44) Filter [codegen id : 15]
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))

(45) ReusedExchange [Reuses operator id: 8]
Output [2]: [cd_demo_sk#11, cd_dep_count#14]

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

(47) Project [codegen id : 15]
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]

(48) ReusedExchange [Reuses operator id: 15]
Output [4]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]

(49) BroadcastHashJoin [codegen id : 15]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#16]
Join condition: None

(50) Project [codegen id : 15]
Output [11]: [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, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]
Input [13]: [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, c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]

(51) ReusedExchange [Reuses operator id: 21]
Output [1]: [cd_demo_sk#22]

(52) BroadcastHashJoin [codegen id : 15]
Left keys [1]: [c_current_cdemo_sk#17]
Right keys [1]: [cd_demo_sk#22]
Join condition: None

(53) Project [codegen id : 15]
Output [10]: [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, c_current_addr_sk#18, c_birth_year#20]
Input [12]: [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, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20, cd_demo_sk#22]

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

(55) ColumnarToRow [codegen id : 12]
Input [3]: [ca_address_sk#24, ca_state#26, ca_country#27]

(56) Filter [codegen id : 12]
Input [3]: [ca_address_sk#24, ca_state#26, ca_country#27]
Condition : (ca_state#26 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#24))

(57) BroadcastExchange
Input [3]: [ca_address_sk#24, ca_state#26, ca_country#27]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#83]

(58) BroadcastHashJoin [codegen id : 15]
Left keys [1]: [c_current_addr_sk#18]
Right keys [1]: [ca_address_sk#24]
Join condition: None

(59) Project [codegen id : 15]
Output [11]: [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, c_birth_year#20, ca_state#26, ca_country#27]
Input [13]: [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, c_current_addr_sk#18, c_birth_year#20, ca_address_sk#24, ca_state#26, ca_country#27]

(60) ReusedExchange [Reuses operator id: 158]
Output [1]: [d_date_sk#29]

(61) BroadcastHashJoin [codegen id : 15]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#29]
Join condition: None

(62) Project [codegen id : 15]
Output [10]: [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, c_birth_year#20, ca_state#26, ca_country#27]
Input [12]: [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, c_birth_year#20, ca_state#26, ca_country#27, d_date_sk#29]

(63) ReusedExchange [Reuses operator id: 36]
Output [2]: [i_item_sk#30, i_item_id#31]

(64) BroadcastHashJoin [codegen id : 15]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [i_item_sk#30]
Join condition: None

(65) Project [codegen id : 15]
Output [10]: [i_item_id#31, ca_country#27, ca_state#26, cast(cs_quantity#4 as decimal(12,2)) AS agg1#33, cast(cs_list_price#5 as decimal(12,2)) AS agg2#34, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#35, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#36, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#37, cast(c_birth_year#20 as decimal(12,2)) AS agg6#38, cast(cd_dep_count#14 as decimal(12,2)) AS agg7#39]
Input [12]: [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, c_birth_year#20, ca_state#26, ca_country#27, i_item_sk#30, i_item_id#31]

(66) HashAggregate [codegen id : 15]
Input [10]: [i_item_id#31, ca_country#27, ca_state#26, agg1#33, agg2#34, agg3#35, agg4#36, agg5#37, agg6#38, agg7#39]
Keys [3]: [i_item_id#31, ca_country#27, ca_state#26]
Functions [7]: [partial_avg(agg1#33), partial_avg(agg2#34), partial_avg(agg3#35), partial_avg(agg4#36), partial_avg(agg5#37), partial_avg(agg6#38), partial_avg(agg7#39)]
Aggregate Attributes [14]: [sum#84, count#85, sum#86, count#87, sum#88, count#89, sum#90, count#91, sum#92, count#93, sum#94, count#95, sum#96, count#97]
Results [17]: [i_item_id#31, ca_country#27, ca_state#26, sum#98, count#99, sum#100, count#101, sum#102, count#103, sum#104, count#105, sum#106, count#107, sum#108, count#109, sum#110, count#111]

(67) Exchange
Input [17]: [i_item_id#31, ca_country#27, ca_state#26, sum#98, count#99, sum#100, count#101, sum#102, count#103, sum#104, count#105, sum#106, count#107, sum#108, count#109, sum#110, count#111]
Arguments: hashpartitioning(i_item_id#31, ca_country#27, ca_state#26, 5), ENSURE_REQUIREMENTS, [id=#112]

(68) HashAggregate [codegen id : 16]
Input [17]: [i_item_id#31, ca_country#27, ca_state#26, sum#98, count#99, sum#100, count#101, sum#102, count#103, sum#104, count#105, sum#106, count#107, sum#108, count#109, sum#110, count#111]
Keys [3]: [i_item_id#31, ca_country#27, ca_state#26]
Functions [7]: [avg(agg1#33), avg(agg2#34), avg(agg3#35), avg(agg4#36), avg(agg5#37), avg(agg6#38), avg(agg7#39)]
Aggregate Attributes [7]: [avg(agg1#33)#113, avg(agg2#34)#114, avg(agg3#35)#115, avg(agg4#36)#116, avg(agg5#37)#117, avg(agg6#38)#118, avg(agg7#39)#119]
Results [11]: [i_item_id#31, ca_country#27, ca_state#26, null AS county#120, avg(agg1#33)#113 AS agg1#121, avg(agg2#34)#114 AS agg2#122, avg(agg3#35)#115 AS agg3#123, avg(agg4#36)#116 AS agg4#124, avg(agg5#37)#117 AS agg5#125, avg(agg6#38)#118 AS agg6#126, avg(agg7#39)#119 AS agg7#127]

(69) 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)>

(70) ColumnarToRow [codegen id : 23]
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]

(71) Filter [codegen id : 23]
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))

(72) ReusedExchange [Reuses operator id: 8]
Output [2]: [cd_demo_sk#11, cd_dep_count#14]

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

(74) Project [codegen id : 23]
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]

(75) ReusedExchange [Reuses operator id: 15]
Output [4]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]

(76) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#16]
Join condition: None

(77) Project [codegen id : 23]
Output [11]: [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, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]
Input [13]: [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, c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]

(78) ReusedExchange [Reuses operator id: 21]
Output [1]: [cd_demo_sk#22]

(79) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [c_current_cdemo_sk#17]
Right keys [1]: [cd_demo_sk#22]
Join condition: None

(80) Project [codegen id : 23]
Output [10]: [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, c_current_addr_sk#18, c_birth_year#20]
Input [12]: [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, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20, cd_demo_sk#22]

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

(82) ColumnarToRow [codegen id : 20]
Input [3]: [ca_address_sk#24, ca_state#26, ca_country#27]

(83) Filter [codegen id : 20]
Input [3]: [ca_address_sk#24, ca_state#26, ca_country#27]
Condition : (ca_state#26 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#24))

(84) Project [codegen id : 20]
Output [2]: [ca_address_sk#24, ca_country#27]
Input [3]: [ca_address_sk#24, ca_state#26, ca_country#27]

(85) BroadcastExchange
Input [2]: [ca_address_sk#24, ca_country#27]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#128]

(86) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [c_current_addr_sk#18]
Right keys [1]: [ca_address_sk#24]
Join condition: None

(87) Project [codegen id : 23]
Output [10]: [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, c_birth_year#20, ca_country#27]
Input [12]: [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, c_current_addr_sk#18, c_birth_year#20, ca_address_sk#24, ca_country#27]

(88) ReusedExchange [Reuses operator id: 158]
Output [1]: [d_date_sk#29]

(89) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#29]
Join condition: None

(90) Project [codegen id : 23]
Output [9]: [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, c_birth_year#20, ca_country#27]
Input [11]: [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, c_birth_year#20, ca_country#27, d_date_sk#29]

(91) ReusedExchange [Reuses operator id: 36]
Output [2]: [i_item_sk#30, i_item_id#31]

(92) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [i_item_sk#30]
Join condition: None

(93) Project [codegen id : 23]
Output [9]: [i_item_id#31, ca_country#27, cast(cs_quantity#4 as decimal(12,2)) AS agg1#33, cast(cs_list_price#5 as decimal(12,2)) AS agg2#34, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#35, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#36, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#37, cast(c_birth_year#20 as decimal(12,2)) AS agg6#38, cast(cd_dep_count#14 as decimal(12,2)) AS agg7#39]
Input [11]: [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, c_birth_year#20, ca_country#27, i_item_sk#30, i_item_id#31]

(94) HashAggregate [codegen id : 23]
Input [9]: [i_item_id#31, ca_country#27, agg1#33, agg2#34, agg3#35, agg4#36, agg5#37, agg6#38, agg7#39]
Keys [2]: [i_item_id#31, ca_country#27]
Functions [7]: [partial_avg(agg1#33), partial_avg(agg2#34), partial_avg(agg3#35), partial_avg(agg4#36), partial_avg(agg5#37), partial_avg(agg6#38), partial_avg(agg7#39)]
Aggregate Attributes [14]: [sum#129, count#130, sum#131, count#132, sum#133, count#134, sum#135, count#136, sum#137, count#138, sum#139, count#140, sum#141, count#142]
Results [16]: [i_item_id#31, ca_country#27, sum#143, count#144, sum#145, count#146, sum#147, count#148, sum#149, count#150, sum#151, count#152, sum#153, count#154, sum#155, count#156]

(95) Exchange
Input [16]: [i_item_id#31, ca_country#27, sum#143, count#144, sum#145, count#146, sum#147, count#148, sum#149, count#150, sum#151, count#152, sum#153, count#154, sum#155, count#156]
Arguments: hashpartitioning(i_item_id#31, ca_country#27, 5), ENSURE_REQUIREMENTS, [id=#157]

(96) HashAggregate [codegen id : 24]
Input [16]: [i_item_id#31, ca_country#27, sum#143, count#144, sum#145, count#146, sum#147, count#148, sum#149, count#150, sum#151, count#152, sum#153, count#154, sum#155, count#156]
Keys [2]: [i_item_id#31, ca_country#27]
Functions [7]: [avg(agg1#33), avg(agg2#34), avg(agg3#35), avg(agg4#36), avg(agg5#37), avg(agg6#38), avg(agg7#39)]
Aggregate Attributes [7]: [avg(agg1#33)#158, avg(agg2#34)#159, avg(agg3#35)#160, avg(agg4#36)#161, avg(agg5#37)#162, avg(agg6#38)#163, avg(agg7#39)#164]
Results [11]: [i_item_id#31, ca_country#27, null AS ca_state#165, null AS county#166, avg(agg1#33)#158 AS agg1#167, avg(agg2#34)#159 AS agg2#168, avg(agg3#35)#160 AS agg3#169, avg(agg4#36)#161 AS agg4#170, avg(agg5#37)#162 AS agg5#171, avg(agg6#38)#163 AS agg6#172, avg(agg7#39)#164 AS agg7#173]

(97) 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)>

(98) ColumnarToRow [codegen id : 31]
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]

(99) Filter [codegen id : 31]
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))

(100) ReusedExchange [Reuses operator id: 8]
Output [2]: [cd_demo_sk#11, cd_dep_count#14]

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

(102) Project [codegen id : 31]
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]

(103) ReusedExchange [Reuses operator id: 15]
Output [4]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]

(104) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#16]
Join condition: None

(105) Project [codegen id : 31]
Output [11]: [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, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]
Input [13]: [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, c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]

(106) ReusedExchange [Reuses operator id: 21]
Output [1]: [cd_demo_sk#22]

(107) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [c_current_cdemo_sk#17]
Right keys [1]: [cd_demo_sk#22]
Join condition: None

(108) Project [codegen id : 31]
Output [10]: [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, c_current_addr_sk#18, c_birth_year#20]
Input [12]: [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, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20, cd_demo_sk#22]

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

(110) ColumnarToRow [codegen id : 28]
Input [2]: [ca_address_sk#24, ca_state#26]

(111) Filter [codegen id : 28]
Input [2]: [ca_address_sk#24, ca_state#26]
Condition : (ca_state#26 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#24))

(112) Project [codegen id : 28]
Output [1]: [ca_address_sk#24]
Input [2]: [ca_address_sk#24, ca_state#26]

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

(114) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [c_current_addr_sk#18]
Right keys [1]: [ca_address_sk#24]
Join condition: None

(115) Project [codegen id : 31]
Output [9]: [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, c_birth_year#20]
Input [11]: [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, c_current_addr_sk#18, c_birth_year#20, ca_address_sk#24]

(116) ReusedExchange [Reuses operator id: 158]
Output [1]: [d_date_sk#29]

(117) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#29]
Join condition: None

(118) Project [codegen id : 31]
Output [8]: [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, c_birth_year#20]
Input [10]: [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, c_birth_year#20, d_date_sk#29]

(119) ReusedExchange [Reuses operator id: 36]
Output [2]: [i_item_sk#30, i_item_id#31]

(120) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [i_item_sk#30]
Join condition: None

(121) Project [codegen id : 31]
Output [8]: [i_item_id#31, cast(cs_quantity#4 as decimal(12,2)) AS agg1#33, cast(cs_list_price#5 as decimal(12,2)) AS agg2#34, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#35, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#36, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#37, cast(c_birth_year#20 as decimal(12,2)) AS agg6#38, cast(cd_dep_count#14 as decimal(12,2)) AS agg7#39]
Input [10]: [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, c_birth_year#20, i_item_sk#30, i_item_id#31]

(122) HashAggregate [codegen id : 31]
Input [8]: [i_item_id#31, agg1#33, agg2#34, agg3#35, agg4#36, agg5#37, agg6#38, agg7#39]
Keys [1]: [i_item_id#31]
Functions [7]: [partial_avg(agg1#33), partial_avg(agg2#34), partial_avg(agg3#35), partial_avg(agg4#36), partial_avg(agg5#37), partial_avg(agg6#38), partial_avg(agg7#39)]
Aggregate Attributes [14]: [sum#175, count#176, sum#177, count#178, sum#179, count#180, sum#181, count#182, sum#183, count#184, sum#185, count#186, sum#187, count#188]
Results [15]: [i_item_id#31, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198, sum#199, count#200, sum#201, count#202]

(123) Exchange
Input [15]: [i_item_id#31, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198, sum#199, count#200, sum#201, count#202]
Arguments: hashpartitioning(i_item_id#31, 5), ENSURE_REQUIREMENTS, [id=#203]

(124) HashAggregate [codegen id : 32]
Input [15]: [i_item_id#31, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198, sum#199, count#200, sum#201, count#202]
Keys [1]: [i_item_id#31]
Functions [7]: [avg(agg1#33), avg(agg2#34), avg(agg3#35), avg(agg4#36), avg(agg5#37), avg(agg6#38), avg(agg7#39)]
Aggregate Attributes [7]: [avg(agg1#33)#204, avg(agg2#34)#205, avg(agg3#35)#206, avg(agg4#36)#207, avg(agg5#37)#208, avg(agg6#38)#209, avg(agg7#39)#210]
Results [11]: [i_item_id#31, null AS ca_country#211, null AS ca_state#212, null AS county#213, avg(agg1#33)#204 AS agg1#214, avg(agg2#34)#205 AS agg2#215, avg(agg3#35)#206 AS agg3#216, avg(agg4#36)#207 AS agg4#217, avg(agg5#37)#208 AS agg5#218, avg(agg6#38)#209 AS agg6#219, avg(agg7#39)#210 AS agg7#220]

(125) 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)>

(126) ColumnarToRow [codegen id : 39]
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]

(127) Filter [codegen id : 39]
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))

(128) ReusedExchange [Reuses operator id: 8]
Output [2]: [cd_demo_sk#11, cd_dep_count#14]

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

(130) Project [codegen id : 39]
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]

(131) ReusedExchange [Reuses operator id: 15]
Output [4]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]

(132) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#16]
Join condition: None

(133) Project [codegen id : 39]
Output [11]: [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, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]
Input [13]: [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, c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20]

(134) ReusedExchange [Reuses operator id: 21]
Output [1]: [cd_demo_sk#22]

(135) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [c_current_cdemo_sk#17]
Right keys [1]: [cd_demo_sk#22]
Join condition: None

(136) Project [codegen id : 39]
Output [10]: [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, c_current_addr_sk#18, c_birth_year#20]
Input [12]: [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, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20, cd_demo_sk#22]

(137) ReusedExchange [Reuses operator id: 113]
Output [1]: [ca_address_sk#24]

(138) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [c_current_addr_sk#18]
Right keys [1]: [ca_address_sk#24]
Join condition: None

(139) Project [codegen id : 39]
Output [9]: [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, c_birth_year#20]
Input [11]: [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, c_current_addr_sk#18, c_birth_year#20, ca_address_sk#24]

(140) ReusedExchange [Reuses operator id: 158]
Output [1]: [d_date_sk#29]

(141) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#29]
Join condition: None

(142) Project [codegen id : 39]
Output [8]: [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, c_birth_year#20]
Input [10]: [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, c_birth_year#20, d_date_sk#29]

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

(144) ColumnarToRow [codegen id : 38]
Input [1]: [i_item_sk#30]

(145) Filter [codegen id : 38]
Input [1]: [i_item_sk#30]
Condition : isnotnull(i_item_sk#30)

(146) BroadcastExchange
Input [1]: [i_item_sk#30]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#221]

(147) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [i_item_sk#30]
Join condition: None

(148) Project [codegen id : 39]
Output [7]: [cast(cs_quantity#4 as decimal(12,2)) AS agg1#33, cast(cs_list_price#5 as decimal(12,2)) AS agg2#34, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#35, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#36, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#37, cast(c_birth_year#20 as decimal(12,2)) AS agg6#38, cast(cd_dep_count#14 as decimal(12,2)) AS agg7#39]
Input [9]: [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, c_birth_year#20, i_item_sk#30]

(149) HashAggregate [codegen id : 39]
Input [7]: [agg1#33, agg2#34, agg3#35, agg4#36, agg5#37, agg6#38, agg7#39]
Keys: []
Functions [7]: [partial_avg(agg1#33), partial_avg(agg2#34), partial_avg(agg3#35), partial_avg(agg4#36), partial_avg(agg5#37), partial_avg(agg6#38), partial_avg(agg7#39)]
Aggregate Attributes [14]: [sum#222, count#223, sum#224, count#225, sum#226, count#227, sum#228, count#229, sum#230, count#231, sum#232, count#233, sum#234, count#235]
Results [14]: [sum#236, count#237, sum#238, count#239, sum#240, count#241, sum#242, count#243, sum#244, count#245, sum#246, count#247, sum#248, count#249]

(150) Exchange
Input [14]: [sum#236, count#237, sum#238, count#239, sum#240, count#241, sum#242, count#243, sum#244, count#245, sum#246, count#247, sum#248, count#249]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#250]

(151) HashAggregate [codegen id : 40]
Input [14]: [sum#236, count#237, sum#238, count#239, sum#240, count#241, sum#242, count#243, sum#244, count#245, sum#246, count#247, sum#248, count#249]
Keys: []
Functions [7]: [avg(agg1#33), avg(agg2#34), avg(agg3#35), avg(agg4#36), avg(agg5#37), avg(agg6#38), avg(agg7#39)]
Aggregate Attributes [7]: [avg(agg1#33)#251, avg(agg2#34)#252, avg(agg3#35)#253, avg(agg4#36)#254, avg(agg5#37)#255, avg(agg6#38)#256, avg(agg7#39)#257]
Results [11]: [null AS i_item_id#258, null AS ca_country#259, null AS ca_state#260, null AS county#261, avg(agg1#33)#251 AS agg1#262, avg(agg2#34)#252 AS agg2#263, avg(agg3#35)#253 AS agg3#264, avg(agg4#36)#254 AS agg4#265, avg(agg5#37)#255 AS agg5#266, avg(agg6#38)#256 AS agg6#267, avg(agg7#39)#257 AS agg7#268]

(152) Union

(153) TakeOrderedAndProject
Input [11]: [i_item_id#31, ca_country#27, ca_state#26, ca_county#25, agg1#76, agg2#77, agg3#78, agg4#79, agg5#80, agg6#81, agg7#82]
Arguments: 100, [ca_country#27 ASC NULLS FIRST, ca_state#26 ASC NULLS FIRST, ca_county#25 ASC NULLS FIRST, i_item_id#31 ASC NULLS FIRST], [i_item_id#31, ca_country#27, ca_state#26, ca_county#25, agg1#76, agg2#77, agg3#78, agg4#79, agg5#80, agg6#81, agg7#82]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10
BroadcastExchange (158)
+- * Project (157)
   +- * Filter (156)
      +- * ColumnarToRow (155)
         +- Scan parquet default.date_dim (154)


(154) Scan parquet default.date_dim
Output [2]: [d_date_sk#29, d_year#269]
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>

(155) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#29, d_year#269]

(156) Filter [codegen id : 1]
Input [2]: [d_date_sk#29, d_year#269]
Condition : ((isnotnull(d_year#269) AND (d_year#269 = 2001)) AND isnotnull(d_date_sk#29))

(157) Project [codegen id : 1]
Output [1]: [d_date_sk#29]
Input [2]: [d_date_sk#29, d_year#269]

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

Subquery:2 Hosting operator id = 42 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10

Subquery:3 Hosting operator id = 69 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10

Subquery:4 Hosting operator id = 97 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10

Subquery:5 Hosting operator id = 125 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10


