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


(1) Scan parquet spark_catalog.default.customer
Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)]
ReadSchema: struct<c_customer_sk:int,c_current_cdemo_sk:int,c_current_addr_sk:int>

(2) ColumnarToRow [codegen id : 9]
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]

(3) Filter [codegen id : 9]
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Condition : ((isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) AND isnotnull(c_current_cdemo_sk#2))

(4) Scan parquet spark_catalog.default.web_sales
Output [2]: [ws_bill_customer_sk#4, ws_sold_date_sk#5]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#5), dynamicpruningexpression(ws_sold_date_sk#5 IN dynamicpruning#6)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int>

(5) ColumnarToRow [codegen id : 2]
Input [2]: [ws_bill_customer_sk#4, ws_sold_date_sk#5]

(6) Filter [codegen id : 2]
Input [2]: [ws_bill_customer_sk#4, ws_sold_date_sk#5]
Condition : isnotnull(ws_bill_customer_sk#4)

(7) ReusedExchange [Reuses operator id: 49]
Output [1]: [d_date_sk#7]

(8) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [ws_sold_date_sk#5]
Right keys [1]: [d_date_sk#7]
Join type: Inner
Join condition: None

(9) Project [codegen id : 2]
Output [1]: [ws_bill_customer_sk#4 AS customer_sk#8]
Input [3]: [ws_bill_customer_sk#4, ws_sold_date_sk#5, d_date_sk#7]

(10) Scan parquet spark_catalog.default.catalog_sales
Output [2]: [cs_ship_customer_sk#9, cs_sold_date_sk#10]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#10), dynamicpruningexpression(cs_sold_date_sk#10 IN dynamicpruning#6)]
PushedFilters: [IsNotNull(cs_ship_customer_sk)]
ReadSchema: struct<cs_ship_customer_sk:int>

(11) ColumnarToRow [codegen id : 4]
Input [2]: [cs_ship_customer_sk#9, cs_sold_date_sk#10]

(12) Filter [codegen id : 4]
Input [2]: [cs_ship_customer_sk#9, cs_sold_date_sk#10]
Condition : isnotnull(cs_ship_customer_sk#9)

(13) ReusedExchange [Reuses operator id: 49]
Output [1]: [d_date_sk#11]

(14) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [cs_sold_date_sk#10]
Right keys [1]: [d_date_sk#11]
Join type: Inner
Join condition: None

(15) Project [codegen id : 4]
Output [1]: [cs_ship_customer_sk#9 AS customer_sk#12]
Input [3]: [cs_ship_customer_sk#9, cs_sold_date_sk#10, d_date_sk#11]

(16) Union

(17) BroadcastExchange
Input [1]: [customer_sk#8]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]

(18) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [customer_sk#8]
Join type: LeftSemi
Join condition: None

(19) Scan parquet spark_catalog.default.store_sales
Output [2]: [ss_customer_sk#13, ss_sold_date_sk#14]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#14), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#6)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int>

(20) ColumnarToRow [codegen id : 6]
Input [2]: [ss_customer_sk#13, ss_sold_date_sk#14]

(21) Filter [codegen id : 6]
Input [2]: [ss_customer_sk#13, ss_sold_date_sk#14]
Condition : isnotnull(ss_customer_sk#13)

(22) ReusedExchange [Reuses operator id: 49]
Output [1]: [d_date_sk#15]

(23) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_sold_date_sk#14]
Right keys [1]: [d_date_sk#15]
Join type: Inner
Join condition: None

(24) Project [codegen id : 6]
Output [1]: [ss_customer_sk#13 AS customer_sk#16]
Input [3]: [ss_customer_sk#13, ss_sold_date_sk#14, d_date_sk#15]

(25) BroadcastExchange
Input [1]: [customer_sk#16]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]

(26) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [customer_sk#16]
Join type: LeftSemi
Join condition: None

(27) Project [codegen id : 9]
Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3]
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]

(28) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#17, ca_county#18]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_county, [Dona Ana County,Douglas County,Gaines County,Richland County,Walker County]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_county:string>

(29) ColumnarToRow [codegen id : 7]
Input [2]: [ca_address_sk#17, ca_county#18]

(30) Filter [codegen id : 7]
Input [2]: [ca_address_sk#17, ca_county#18]
Condition : (ca_county#18 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#17))

(31) Project [codegen id : 7]
Output [1]: [ca_address_sk#17]
Input [2]: [ca_address_sk#17, ca_county#18]

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

(33) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_current_addr_sk#3]
Right keys [1]: [ca_address_sk#17]
Join type: Inner
Join condition: None

(34) Project [codegen id : 9]
Output [1]: [c_current_cdemo_sk#2]
Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#17]

(35) Scan parquet spark_catalog.default.customer_demographics
Output [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_demographics]
PushedFilters: [IsNotNull(cd_demo_sk)]
ReadSchema: struct<cd_demo_sk:int,cd_gender:string,cd_marital_status:string,cd_education_status:string,cd_purchase_estimate:int,cd_credit_rating:string,cd_dep_count:int,cd_dep_employed_count:int,cd_dep_college_count:int>

(36) ColumnarToRow [codegen id : 8]
Input [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]

(37) Filter [codegen id : 8]
Input [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Condition : isnotnull(cd_demo_sk#19)

(38) BroadcastExchange
Input [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

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

(40) Project [codegen id : 9]
Output [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]

(41) HashAggregate [codegen id : 9]
Input [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Keys [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#28]
Results [9]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#29]

(42) Exchange
Input [9]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#29]
Arguments: hashpartitioning(cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(43) HashAggregate [codegen id : 10]
Input [9]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#29]
Keys [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#30]
Results [14]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, count(1)#30 AS cnt1#31, cd_purchase_estimate#23, count(1)#30 AS cnt2#32, cd_credit_rating#24, count(1)#30 AS cnt3#33, cd_dep_count#25, count(1)#30 AS cnt4#34, cd_dep_employed_count#26, count(1)#30 AS cnt5#35, cd_dep_college_count#27, count(1)#30 AS cnt6#36]

(44) TakeOrderedAndProject
Input [14]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cnt1#31, cd_purchase_estimate#23, cnt2#32, cd_credit_rating#24, cnt3#33, cd_dep_count#25, cnt4#34, cd_dep_employed_count#26, cnt5#35, cd_dep_college_count#27, cnt6#36]
Arguments: 100, [cd_gender#20 ASC NULLS FIRST, cd_marital_status#21 ASC NULLS FIRST, cd_education_status#22 ASC NULLS FIRST, cd_purchase_estimate#23 ASC NULLS FIRST, cd_credit_rating#24 ASC NULLS FIRST, cd_dep_count#25 ASC NULLS FIRST, cd_dep_employed_count#26 ASC NULLS FIRST, cd_dep_college_count#27 ASC NULLS FIRST], [cd_gender#20, cd_marital_status#21, cd_education_status#22, cnt1#31, cd_purchase_estimate#23, cnt2#32, cd_credit_rating#24, cnt3#33, cd_dep_count#25, cnt4#34, cd_dep_employed_count#26, cnt5#35, cd_dep_college_count#27, cnt6#36]

===== Subqueries =====

Subquery:1 Hosting operator id = 4 Hosting Expression = ws_sold_date_sk#5 IN dynamicpruning#6
BroadcastExchange (49)
+- * Project (48)
   +- * Filter (47)
      +- * ColumnarToRow (46)
         +- Scan parquet spark_catalog.default.date_dim (45)


(45) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#7, d_year#37, d_moy#38]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,7), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(46) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#7, d_year#37, d_moy#38]

(47) Filter [codegen id : 1]
Input [3]: [d_date_sk#7, d_year#37, d_moy#38]
Condition : (((((isnotnull(d_year#37) AND isnotnull(d_moy#38)) AND (d_year#37 = 2002)) AND (d_moy#38 >= 4)) AND (d_moy#38 <= 7)) AND isnotnull(d_date_sk#7))

(48) Project [codegen id : 1]
Output [1]: [d_date_sk#7]
Input [3]: [d_date_sk#7, d_year#37, d_moy#38]

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

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

Subquery:3 Hosting operator id = 19 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#6


