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


(1) Scan parquet spark_catalog.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)]
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 spark_catalog.default.customer_demographics
Output [4]: [cd_demo_sk#10, cd_gender#11, cd_education_status#12, cd_dep_count#13]
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#10, cd_gender#11, cd_education_status#12, cd_dep_count#13]

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

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

(8) BroadcastExchange
Input [2]: [cd_demo_sk#10, cd_dep_count#13]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]

(9) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [cs_bill_cdemo_sk#2]
Right keys [1]: [cd_demo_sk#10]
Join type: Inner
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#13]
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#10, cd_dep_count#13]

(11) Scan parquet spark_catalog.default.customer
Output [5]: [c_customer_sk#14, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_month#17, c_birth_year#18]
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#14, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_month#17, c_birth_year#18]

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

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

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

(16) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#14]
Join type: Inner
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#13, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18]
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#13, c_customer_sk#14, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18]

(18) Scan parquet spark_catalog.default.customer_demographics
Output [1]: [cd_demo_sk#19]
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#19]

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

(21) BroadcastExchange
Input [1]: [cd_demo_sk#19]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]

(22) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [c_current_cdemo_sk#15]
Right keys [1]: [cd_demo_sk#19]
Join type: Inner
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#13, c_current_addr_sk#16, c_birth_year#18]
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#13, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18, cd_demo_sk#19]

(24) Scan parquet spark_catalog.default.customer_address
Output [4]: [ca_address_sk#20, ca_county#21, ca_state#22, ca_country#23]
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#20, ca_county#21, ca_state#22, ca_country#23]

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

(27) BroadcastExchange
Input [4]: [ca_address_sk#20, ca_county#21, ca_state#22, ca_country#23]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

(28) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [c_current_addr_sk#16]
Right keys [1]: [ca_address_sk#20]
Join type: Inner
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#13, c_birth_year#18, ca_county#21, ca_state#22, ca_country#23]
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#13, c_current_addr_sk#16, c_birth_year#18, ca_address_sk#20, ca_county#21, ca_state#22, ca_country#23]

(30) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#24, d_year#25]
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>

(31) ColumnarToRow [codegen id : 5]
Input [2]: [d_date_sk#24, d_year#25]

(32) Filter [codegen id : 5]
Input [2]: [d_date_sk#24, d_year#25]
Condition : ((isnotnull(d_year#25) AND (d_year#25 = 2001)) AND isnotnull(d_date_sk#24))

(33) Project [codegen id : 5]
Output [1]: [d_date_sk#24]
Input [2]: [d_date_sk#24, d_year#25]

(34) BroadcastExchange
Input [1]: [d_date_sk#24]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]

(35) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#24]
Join type: Inner
Join condition: None

(36) 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#13, c_birth_year#18, ca_county#21, ca_state#22, ca_country#23]
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#13, c_birth_year#18, ca_county#21, ca_state#22, ca_country#23, d_date_sk#24]

(37) Scan parquet spark_catalog.default.item
Output [2]: [i_item_sk#26, i_item_id#27]
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>

(38) ColumnarToRow [codegen id : 6]
Input [2]: [i_item_sk#26, i_item_id#27]

(39) Filter [codegen id : 6]
Input [2]: [i_item_sk#26, i_item_id#27]
Condition : isnotnull(i_item_sk#26)

(40) BroadcastExchange
Input [2]: [i_item_sk#26, i_item_id#27]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=6]

(41) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [i_item_sk#26]
Join type: Inner
Join condition: None

(42) Project [codegen id : 7]
Output [11]: [i_item_id#27, ca_country#23, ca_state#22, ca_county#21, cast(cs_quantity#4 as decimal(12,2)) AS agg1#28, cast(cs_list_price#5 as decimal(12,2)) AS agg2#29, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#30, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#31, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#32, cast(c_birth_year#18 as decimal(12,2)) AS agg6#33, cast(cd_dep_count#13 as decimal(12,2)) AS agg7#34]
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#13, c_birth_year#18, ca_county#21, ca_state#22, ca_country#23, i_item_sk#26, i_item_id#27]

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

(44) Exchange
Input [18]: [i_item_id#27, ca_country#23, ca_state#22, ca_county#21, sum#49, count#50, sum#51, count#52, sum#53, count#54, sum#55, count#56, sum#57, count#58, sum#59, count#60, sum#61, count#62]
Arguments: hashpartitioning(i_item_id#27, ca_country#23, ca_state#22, ca_county#21, 5), ENSURE_REQUIREMENTS, [plan_id=7]

(45) HashAggregate [codegen id : 8]
Input [18]: [i_item_id#27, ca_country#23, ca_state#22, ca_county#21, sum#49, count#50, sum#51, count#52, sum#53, count#54, sum#55, count#56, sum#57, count#58, sum#59, count#60, sum#61, count#62]
Keys [4]: [i_item_id#27, ca_country#23, ca_state#22, ca_county#21]
Functions [7]: [avg(agg1#28), avg(agg2#29), avg(agg3#30), avg(agg4#31), avg(agg5#32), avg(agg6#33), avg(agg7#34)]
Aggregate Attributes [7]: [avg(agg1#28)#63, avg(agg2#29)#64, avg(agg3#30)#65, avg(agg4#31)#66, avg(agg5#32)#67, avg(agg6#33)#68, avg(agg7#34)#69]
Results [11]: [i_item_id#27, ca_country#23, ca_state#22, ca_county#21, avg(agg1#28)#63 AS agg1#70, avg(agg2#29)#64 AS agg2#71, avg(agg3#30)#65 AS agg3#72, avg(agg4#31)#66 AS agg4#73, avg(agg5#32)#67 AS agg5#74, avg(agg6#33)#68 AS agg6#75, avg(agg7#34)#69 AS agg7#76]

(46) Scan parquet spark_catalog.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)]
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)>

(47) 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]

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

(49) ReusedExchange [Reuses operator id: 8]
Output [2]: [cd_demo_sk#10, cd_dep_count#13]

(50) BroadcastHashJoin [codegen id : 15]
Left keys [1]: [cs_bill_cdemo_sk#2]
Right keys [1]: [cd_demo_sk#10]
Join type: Inner
Join condition: None

(51) 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#13]
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#10, cd_dep_count#13]

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

(53) BroadcastHashJoin [codegen id : 15]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#14]
Join type: Inner
Join condition: None

(54) 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#13, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18]
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#13, c_customer_sk#14, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18]

(55) ReusedExchange [Reuses operator id: 21]
Output [1]: [cd_demo_sk#19]

(56) BroadcastHashJoin [codegen id : 15]
Left keys [1]: [c_current_cdemo_sk#15]
Right keys [1]: [cd_demo_sk#19]
Join type: Inner
Join condition: None

(57) 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#13, c_current_addr_sk#16, c_birth_year#18]
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#13, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18, cd_demo_sk#19]

(58) Scan parquet spark_catalog.default.customer_address
Output [3]: [ca_address_sk#20, ca_state#22, ca_country#23]
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>

(59) ColumnarToRow [codegen id : 12]
Input [3]: [ca_address_sk#20, ca_state#22, ca_country#23]

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

(61) BroadcastExchange
Input [3]: [ca_address_sk#20, ca_state#22, ca_country#23]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=8]

(62) BroadcastHashJoin [codegen id : 15]
Left keys [1]: [c_current_addr_sk#16]
Right keys [1]: [ca_address_sk#20]
Join type: Inner
Join condition: None

(63) 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#13, c_birth_year#18, ca_state#22, ca_country#23]
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#13, c_current_addr_sk#16, c_birth_year#18, ca_address_sk#20, ca_state#22, ca_country#23]

(64) ReusedExchange [Reuses operator id: 34]
Output [1]: [d_date_sk#24]

(65) BroadcastHashJoin [codegen id : 15]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#24]
Join type: Inner
Join condition: None

(66) 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#13, c_birth_year#18, ca_state#22, ca_country#23]
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#13, c_birth_year#18, ca_state#22, ca_country#23, d_date_sk#24]

(67) ReusedExchange [Reuses operator id: 40]
Output [2]: [i_item_sk#26, i_item_id#27]

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

(69) Project [codegen id : 15]
Output [10]: [i_item_id#27, ca_country#23, ca_state#22, cast(cs_quantity#4 as decimal(12,2)) AS agg1#28, cast(cs_list_price#5 as decimal(12,2)) AS agg2#29, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#30, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#31, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#32, cast(c_birth_year#18 as decimal(12,2)) AS agg6#33, cast(cd_dep_count#13 as decimal(12,2)) AS agg7#34]
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#13, c_birth_year#18, ca_state#22, ca_country#23, i_item_sk#26, i_item_id#27]

(70) HashAggregate [codegen id : 15]
Input [10]: [i_item_id#27, ca_country#23, ca_state#22, agg1#28, agg2#29, agg3#30, agg4#31, agg5#32, agg6#33, agg7#34]
Keys [3]: [i_item_id#27, ca_country#23, ca_state#22]
Functions [7]: [partial_avg(agg1#28), partial_avg(agg2#29), partial_avg(agg3#30), partial_avg(agg4#31), partial_avg(agg5#32), partial_avg(agg6#33), partial_avg(agg7#34)]
Aggregate Attributes [14]: [sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84, sum#85, count#86, sum#87, count#88, sum#89, count#90]
Results [17]: [i_item_id#27, ca_country#23, ca_state#22, sum#91, count#92, sum#93, count#94, sum#95, count#96, sum#97, count#98, sum#99, count#100, sum#101, count#102, sum#103, count#104]

(71) Exchange
Input [17]: [i_item_id#27, ca_country#23, ca_state#22, sum#91, count#92, sum#93, count#94, sum#95, count#96, sum#97, count#98, sum#99, count#100, sum#101, count#102, sum#103, count#104]
Arguments: hashpartitioning(i_item_id#27, ca_country#23, ca_state#22, 5), ENSURE_REQUIREMENTS, [plan_id=9]

(72) HashAggregate [codegen id : 16]
Input [17]: [i_item_id#27, ca_country#23, ca_state#22, sum#91, count#92, sum#93, count#94, sum#95, count#96, sum#97, count#98, sum#99, count#100, sum#101, count#102, sum#103, count#104]
Keys [3]: [i_item_id#27, ca_country#23, ca_state#22]
Functions [7]: [avg(agg1#28), avg(agg2#29), avg(agg3#30), avg(agg4#31), avg(agg5#32), avg(agg6#33), avg(agg7#34)]
Aggregate Attributes [7]: [avg(agg1#28)#105, avg(agg2#29)#106, avg(agg3#30)#107, avg(agg4#31)#108, avg(agg5#32)#109, avg(agg6#33)#110, avg(agg7#34)#111]
Results [11]: [i_item_id#27, ca_country#23, ca_state#22, null AS county#112, avg(agg1#28)#105 AS agg1#113, avg(agg2#29)#106 AS agg2#114, avg(agg3#30)#107 AS agg3#115, avg(agg4#31)#108 AS agg4#116, avg(agg5#32)#109 AS agg5#117, avg(agg6#33)#110 AS agg6#118, avg(agg7#34)#111 AS agg7#119]

(73) Scan parquet spark_catalog.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)]
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)>

(74) 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]

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

(76) ReusedExchange [Reuses operator id: 8]
Output [2]: [cd_demo_sk#10, cd_dep_count#13]

(77) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [cs_bill_cdemo_sk#2]
Right keys [1]: [cd_demo_sk#10]
Join type: Inner
Join condition: None

(78) 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#13]
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#10, cd_dep_count#13]

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

(80) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#14]
Join type: Inner
Join condition: None

(81) 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#13, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18]
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#13, c_customer_sk#14, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18]

(82) ReusedExchange [Reuses operator id: 21]
Output [1]: [cd_demo_sk#19]

(83) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [c_current_cdemo_sk#15]
Right keys [1]: [cd_demo_sk#19]
Join type: Inner
Join condition: None

(84) 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#13, c_current_addr_sk#16, c_birth_year#18]
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#13, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18, cd_demo_sk#19]

(85) Scan parquet spark_catalog.default.customer_address
Output [3]: [ca_address_sk#20, ca_state#22, ca_country#23]
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>

(86) ColumnarToRow [codegen id : 20]
Input [3]: [ca_address_sk#20, ca_state#22, ca_country#23]

(87) Filter [codegen id : 20]
Input [3]: [ca_address_sk#20, ca_state#22, ca_country#23]
Condition : (ca_state#22 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#20))

(88) Project [codegen id : 20]
Output [2]: [ca_address_sk#20, ca_country#23]
Input [3]: [ca_address_sk#20, ca_state#22, ca_country#23]

(89) BroadcastExchange
Input [2]: [ca_address_sk#20, ca_country#23]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=10]

(90) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [c_current_addr_sk#16]
Right keys [1]: [ca_address_sk#20]
Join type: Inner
Join condition: None

(91) 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#13, c_birth_year#18, ca_country#23]
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#13, c_current_addr_sk#16, c_birth_year#18, ca_address_sk#20, ca_country#23]

(92) ReusedExchange [Reuses operator id: 34]
Output [1]: [d_date_sk#24]

(93) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#24]
Join type: Inner
Join condition: None

(94) 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#13, c_birth_year#18, ca_country#23]
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#13, c_birth_year#18, ca_country#23, d_date_sk#24]

(95) ReusedExchange [Reuses operator id: 40]
Output [2]: [i_item_sk#26, i_item_id#27]

(96) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [i_item_sk#26]
Join type: Inner
Join condition: None

(97) Project [codegen id : 23]
Output [9]: [i_item_id#27, ca_country#23, cast(cs_quantity#4 as decimal(12,2)) AS agg1#28, cast(cs_list_price#5 as decimal(12,2)) AS agg2#29, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#30, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#31, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#32, cast(c_birth_year#18 as decimal(12,2)) AS agg6#33, cast(cd_dep_count#13 as decimal(12,2)) AS agg7#34]
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#13, c_birth_year#18, ca_country#23, i_item_sk#26, i_item_id#27]

(98) HashAggregate [codegen id : 23]
Input [9]: [i_item_id#27, ca_country#23, agg1#28, agg2#29, agg3#30, agg4#31, agg5#32, agg6#33, agg7#34]
Keys [2]: [i_item_id#27, ca_country#23]
Functions [7]: [partial_avg(agg1#28), partial_avg(agg2#29), partial_avg(agg3#30), partial_avg(agg4#31), partial_avg(agg5#32), partial_avg(agg6#33), partial_avg(agg7#34)]
Aggregate Attributes [14]: [sum#120, count#121, sum#122, count#123, sum#124, count#125, sum#126, count#127, sum#128, count#129, sum#130, count#131, sum#132, count#133]
Results [16]: [i_item_id#27, ca_country#23, sum#134, count#135, sum#136, count#137, sum#138, count#139, sum#140, count#141, sum#142, count#143, sum#144, count#145, sum#146, count#147]

(99) Exchange
Input [16]: [i_item_id#27, ca_country#23, sum#134, count#135, sum#136, count#137, sum#138, count#139, sum#140, count#141, sum#142, count#143, sum#144, count#145, sum#146, count#147]
Arguments: hashpartitioning(i_item_id#27, ca_country#23, 5), ENSURE_REQUIREMENTS, [plan_id=11]

(100) HashAggregate [codegen id : 24]
Input [16]: [i_item_id#27, ca_country#23, sum#134, count#135, sum#136, count#137, sum#138, count#139, sum#140, count#141, sum#142, count#143, sum#144, count#145, sum#146, count#147]
Keys [2]: [i_item_id#27, ca_country#23]
Functions [7]: [avg(agg1#28), avg(agg2#29), avg(agg3#30), avg(agg4#31), avg(agg5#32), avg(agg6#33), avg(agg7#34)]
Aggregate Attributes [7]: [avg(agg1#28)#148, avg(agg2#29)#149, avg(agg3#30)#150, avg(agg4#31)#151, avg(agg5#32)#152, avg(agg6#33)#153, avg(agg7#34)#154]
Results [11]: [i_item_id#27, ca_country#23, null AS ca_state#155, null AS county#156, avg(agg1#28)#148 AS agg1#157, avg(agg2#29)#149 AS agg2#158, avg(agg3#30)#150 AS agg3#159, avg(agg4#31)#151 AS agg4#160, avg(agg5#32)#152 AS agg5#161, avg(agg6#33)#153 AS agg6#162, avg(agg7#34)#154 AS agg7#163]

(101) Scan parquet spark_catalog.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)]
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)>

(102) 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]

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

(104) ReusedExchange [Reuses operator id: 8]
Output [2]: [cd_demo_sk#10, cd_dep_count#13]

(105) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [cs_bill_cdemo_sk#2]
Right keys [1]: [cd_demo_sk#10]
Join type: Inner
Join condition: None

(106) 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#13]
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#10, cd_dep_count#13]

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

(108) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#14]
Join type: Inner
Join condition: None

(109) 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#13, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18]
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#13, c_customer_sk#14, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18]

(110) ReusedExchange [Reuses operator id: 21]
Output [1]: [cd_demo_sk#19]

(111) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [c_current_cdemo_sk#15]
Right keys [1]: [cd_demo_sk#19]
Join type: Inner
Join condition: None

(112) 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#13, c_current_addr_sk#16, c_birth_year#18]
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#13, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18, cd_demo_sk#19]

(113) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#20, ca_state#22]
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>

(114) ColumnarToRow [codegen id : 28]
Input [2]: [ca_address_sk#20, ca_state#22]

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

(116) Project [codegen id : 28]
Output [1]: [ca_address_sk#20]
Input [2]: [ca_address_sk#20, ca_state#22]

(117) BroadcastExchange
Input [1]: [ca_address_sk#20]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=12]

(118) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [c_current_addr_sk#16]
Right keys [1]: [ca_address_sk#20]
Join type: Inner
Join condition: None

(119) 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#13, c_birth_year#18]
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#13, c_current_addr_sk#16, c_birth_year#18, ca_address_sk#20]

(120) ReusedExchange [Reuses operator id: 34]
Output [1]: [d_date_sk#24]

(121) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#24]
Join type: Inner
Join condition: None

(122) 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#13, c_birth_year#18]
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#13, c_birth_year#18, d_date_sk#24]

(123) ReusedExchange [Reuses operator id: 40]
Output [2]: [i_item_sk#26, i_item_id#27]

(124) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [i_item_sk#26]
Join type: Inner
Join condition: None

(125) Project [codegen id : 31]
Output [8]: [i_item_id#27, cast(cs_quantity#4 as decimal(12,2)) AS agg1#28, cast(cs_list_price#5 as decimal(12,2)) AS agg2#29, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#30, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#31, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#32, cast(c_birth_year#18 as decimal(12,2)) AS agg6#33, cast(cd_dep_count#13 as decimal(12,2)) AS agg7#34]
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#13, c_birth_year#18, i_item_sk#26, i_item_id#27]

(126) HashAggregate [codegen id : 31]
Input [8]: [i_item_id#27, agg1#28, agg2#29, agg3#30, agg4#31, agg5#32, agg6#33, agg7#34]
Keys [1]: [i_item_id#27]
Functions [7]: [partial_avg(agg1#28), partial_avg(agg2#29), partial_avg(agg3#30), partial_avg(agg4#31), partial_avg(agg5#32), partial_avg(agg6#33), partial_avg(agg7#34)]
Aggregate Attributes [14]: [sum#164, count#165, sum#166, count#167, sum#168, count#169, sum#170, count#171, sum#172, count#173, sum#174, count#175, sum#176, count#177]
Results [15]: [i_item_id#27, sum#178, count#179, sum#180, count#181, sum#182, count#183, sum#184, count#185, sum#186, count#187, sum#188, count#189, sum#190, count#191]

(127) Exchange
Input [15]: [i_item_id#27, sum#178, count#179, sum#180, count#181, sum#182, count#183, sum#184, count#185, sum#186, count#187, sum#188, count#189, sum#190, count#191]
Arguments: hashpartitioning(i_item_id#27, 5), ENSURE_REQUIREMENTS, [plan_id=13]

(128) HashAggregate [codegen id : 32]
Input [15]: [i_item_id#27, sum#178, count#179, sum#180, count#181, sum#182, count#183, sum#184, count#185, sum#186, count#187, sum#188, count#189, sum#190, count#191]
Keys [1]: [i_item_id#27]
Functions [7]: [avg(agg1#28), avg(agg2#29), avg(agg3#30), avg(agg4#31), avg(agg5#32), avg(agg6#33), avg(agg7#34)]
Aggregate Attributes [7]: [avg(agg1#28)#192, avg(agg2#29)#193, avg(agg3#30)#194, avg(agg4#31)#195, avg(agg5#32)#196, avg(agg6#33)#197, avg(agg7#34)#198]
Results [11]: [i_item_id#27, null AS ca_country#199, null AS ca_state#200, null AS county#201, avg(agg1#28)#192 AS agg1#202, avg(agg2#29)#193 AS agg2#203, avg(agg3#30)#194 AS agg3#204, avg(agg4#31)#195 AS agg4#205, avg(agg5#32)#196 AS agg5#206, avg(agg6#33)#197 AS agg6#207, avg(agg7#34)#198 AS agg7#208]

(129) Scan parquet spark_catalog.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)]
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)>

(130) 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]

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

(132) ReusedExchange [Reuses operator id: 8]
Output [2]: [cd_demo_sk#10, cd_dep_count#13]

(133) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [cs_bill_cdemo_sk#2]
Right keys [1]: [cd_demo_sk#10]
Join type: Inner
Join condition: None

(134) 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#13]
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#10, cd_dep_count#13]

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

(136) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#14]
Join type: Inner
Join condition: None

(137) 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#13, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18]
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#13, c_customer_sk#14, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18]

(138) ReusedExchange [Reuses operator id: 21]
Output [1]: [cd_demo_sk#19]

(139) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [c_current_cdemo_sk#15]
Right keys [1]: [cd_demo_sk#19]
Join type: Inner
Join condition: None

(140) 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#13, c_current_addr_sk#16, c_birth_year#18]
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#13, c_current_cdemo_sk#15, c_current_addr_sk#16, c_birth_year#18, cd_demo_sk#19]

(141) ReusedExchange [Reuses operator id: 117]
Output [1]: [ca_address_sk#20]

(142) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [c_current_addr_sk#16]
Right keys [1]: [ca_address_sk#20]
Join type: Inner
Join condition: None

(143) 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#13, c_birth_year#18]
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#13, c_current_addr_sk#16, c_birth_year#18, ca_address_sk#20]

(144) ReusedExchange [Reuses operator id: 34]
Output [1]: [d_date_sk#24]

(145) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [cs_sold_date_sk#9]
Right keys [1]: [d_date_sk#24]
Join type: Inner
Join condition: None

(146) 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#13, c_birth_year#18]
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#13, c_birth_year#18, d_date_sk#24]

(147) Scan parquet spark_catalog.default.item
Output [1]: [i_item_sk#26]
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 : 38]
Input [1]: [i_item_sk#26]

(149) Filter [codegen id : 38]
Input [1]: [i_item_sk#26]
Condition : isnotnull(i_item_sk#26)

(150) BroadcastExchange
Input [1]: [i_item_sk#26]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=14]

(151) BroadcastHashJoin [codegen id : 39]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [i_item_sk#26]
Join type: Inner
Join condition: None

(152) Project [codegen id : 39]
Output [7]: [cast(cs_quantity#4 as decimal(12,2)) AS agg1#28, cast(cs_list_price#5 as decimal(12,2)) AS agg2#29, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#30, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#31, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#32, cast(c_birth_year#18 as decimal(12,2)) AS agg6#33, cast(cd_dep_count#13 as decimal(12,2)) AS agg7#34]
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#13, c_birth_year#18, i_item_sk#26]

(153) HashAggregate [codegen id : 39]
Input [7]: [agg1#28, agg2#29, agg3#30, agg4#31, agg5#32, agg6#33, agg7#34]
Keys: []
Functions [7]: [partial_avg(agg1#28), partial_avg(agg2#29), partial_avg(agg3#30), partial_avg(agg4#31), partial_avg(agg5#32), partial_avg(agg6#33), partial_avg(agg7#34)]
Aggregate Attributes [14]: [sum#209, count#210, sum#211, count#212, sum#213, count#214, sum#215, count#216, sum#217, count#218, sum#219, count#220, sum#221, count#222]
Results [14]: [sum#223, count#224, sum#225, count#226, sum#227, count#228, sum#229, count#230, sum#231, count#232, sum#233, count#234, sum#235, count#236]

(154) Exchange
Input [14]: [sum#223, count#224, sum#225, count#226, sum#227, count#228, sum#229, count#230, sum#231, count#232, sum#233, count#234, sum#235, count#236]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=15]

(155) HashAggregate [codegen id : 40]
Input [14]: [sum#223, count#224, sum#225, count#226, sum#227, count#228, sum#229, count#230, sum#231, count#232, sum#233, count#234, sum#235, count#236]
Keys: []
Functions [7]: [avg(agg1#28), avg(agg2#29), avg(agg3#30), avg(agg4#31), avg(agg5#32), avg(agg6#33), avg(agg7#34)]
Aggregate Attributes [7]: [avg(agg1#28)#237, avg(agg2#29)#238, avg(agg3#30)#239, avg(agg4#31)#240, avg(agg5#32)#241, avg(agg6#33)#242, avg(agg7#34)#243]
Results [11]: [null AS i_item_id#244, null AS ca_country#245, null AS ca_state#246, null AS county#247, avg(agg1#28)#237 AS agg1#248, avg(agg2#29)#238 AS agg2#249, avg(agg3#30)#239 AS agg3#250, avg(agg4#31)#240 AS agg4#251, avg(agg5#32)#241 AS agg5#252, avg(agg6#33)#242 AS agg6#253, avg(agg7#34)#243 AS agg7#254]

(156) Union

(157) TakeOrderedAndProject
Input [11]: [i_item_id#27, ca_country#23, ca_state#22, ca_county#21, agg1#70, agg2#71, agg3#72, agg4#73, agg5#74, agg6#75, agg7#76]
Arguments: 100, [ca_country#23 ASC NULLS FIRST, ca_state#22 ASC NULLS FIRST, ca_county#21 ASC NULLS FIRST, i_item_id#27 ASC NULLS FIRST], [i_item_id#27, ca_country#23, ca_state#22, ca_county#21, agg1#70, agg2#71, agg3#72, agg4#73, agg5#74, agg6#75, agg7#76]

