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


(1) CometNativeScan parquet spark_catalog.default.customer
Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [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) CometFilter
Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4))

(3) CometColumnarToRow [codegen id : 9]
Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]

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

(5) ColumnarToRow [codegen id : 2]
Input [2]: [ss_customer_sk#6, ss_sold_date_sk#7]

(6) ReusedExchange [Reuses operator id: 50]
Output [1]: [d_date_sk#9]

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

(8) Project [codegen id : 2]
Output [1]: [ss_customer_sk#6]
Input [3]: [ss_customer_sk#6, ss_sold_date_sk#7, d_date_sk#9]

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

(10) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [ss_customer_sk#6]
Join type: LeftSemi
Join condition: None

(11) Scan parquet spark_catalog.default.web_sales
Output [2]: [ws_bill_customer_sk#10, ws_sold_date_sk#11]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#11), dynamicpruningexpression(ws_sold_date_sk#11 IN dynamicpruning#8)]
ReadSchema: struct<ws_bill_customer_sk:int>

(12) ColumnarToRow [codegen id : 4]
Input [2]: [ws_bill_customer_sk#10, ws_sold_date_sk#11]

(13) ReusedExchange [Reuses operator id: 50]
Output [1]: [d_date_sk#9]

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

(15) Project [codegen id : 4]
Output [1]: [ws_bill_customer_sk#10]
Input [3]: [ws_bill_customer_sk#10, ws_sold_date_sk#11, d_date_sk#9]

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

(17) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [ws_bill_customer_sk#10]
Join type: ExistenceJoin(exists#2)
Join condition: None

(18) Scan parquet spark_catalog.default.catalog_sales
Output [2]: [cs_ship_customer_sk#12, cs_sold_date_sk#13]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#13), dynamicpruningexpression(cs_sold_date_sk#13 IN dynamicpruning#8)]
ReadSchema: struct<cs_ship_customer_sk:int>

(19) ColumnarToRow [codegen id : 6]
Input [2]: [cs_ship_customer_sk#12, cs_sold_date_sk#13]

(20) ReusedExchange [Reuses operator id: 50]
Output [1]: [d_date_sk#9]

(21) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [cs_sold_date_sk#13]
Right keys [1]: [d_date_sk#9]
Join type: Inner
Join condition: None

(22) Project [codegen id : 6]
Output [1]: [cs_ship_customer_sk#12]
Input [3]: [cs_ship_customer_sk#12, cs_sold_date_sk#13, d_date_sk#9]

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

(24) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [cs_ship_customer_sk#12]
Join type: ExistenceJoin(exists#1)
Join condition: None

(25) Filter [codegen id : 9]
Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1]
Condition : (exists#2 OR exists#1)

(26) Project [codegen id : 9]
Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5]
Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1]

(27) CometNativeScan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#14, ca_county#15]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_county, [Dona Ana County,Jefferson County,La Porte County,Rush County,Toole County]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_county:string>

(28) CometFilter
Input [2]: [ca_address_sk#14, ca_county#15]
Condition : (ca_county#15 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#14))

(29) CometProject
Input [2]: [ca_address_sk#14, ca_county#15]
Arguments: [ca_address_sk#14], [ca_address_sk#14]

(30) CometColumnarToRow [codegen id : 7]
Input [1]: [ca_address_sk#14]

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

(32) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_current_addr_sk#5]
Right keys [1]: [ca_address_sk#14]
Join type: Inner
Join condition: None

(33) Project [codegen id : 9]
Output [1]: [c_current_cdemo_sk#4]
Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#14]

(34) CometNativeScan parquet spark_catalog.default.customer_demographics
Output [9]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24]
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>

(35) CometFilter
Input [9]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24]
Condition : isnotnull(cd_demo_sk#16)

(36) CometProject
Input [9]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24]
Arguments: [cd_demo_sk#16, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#20, cd_credit_rating#28, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24], [cd_demo_sk#16, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, cd_gender#17, 1, true, false, true) AS cd_gender#25, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, cd_marital_status#18, 1, true, false, true) AS cd_marital_status#26, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, cd_education_status#19, 20, true, false, true) AS cd_education_status#27, cd_purchase_estimate#20, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, cd_credit_rating#21, 10, true, false, true) AS cd_credit_rating#28, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24]

(37) CometColumnarToRow [codegen id : 8]
Input [9]: [cd_demo_sk#16, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#20, cd_credit_rating#28, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24]

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

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

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

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

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

(43) CometColumnarToRow [codegen id : 10]
Input [9]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#20, cd_credit_rating#28, cd_dep_count#22, cd_dep_employed_count#23, cd_dep_college_count#24, count#30]

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

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

===== Subqueries =====

Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8
BroadcastExchange (50)
+- * CometColumnarToRow (49)
   +- CometProject (48)
      +- CometFilter (47)
         +- CometNativeScan parquet spark_catalog.default.date_dim (46)


(46) CometNativeScan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#9, d_year#38, d_moy#39]
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,1), LessThanOrEqual(d_moy,4), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(47) CometFilter
Input [3]: [d_date_sk#9, d_year#38, d_moy#39]
Condition : (((((isnotnull(d_year#38) AND isnotnull(d_moy#39)) AND (d_year#38 = 2002)) AND (d_moy#39 >= 1)) AND (d_moy#39 <= 4)) AND isnotnull(d_date_sk#9))

(48) CometProject
Input [3]: [d_date_sk#9, d_year#38, d_moy#39]
Arguments: [d_date_sk#9], [d_date_sk#9]

(49) CometColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#9]

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

Subquery:2 Hosting operator id = 11 Hosting Expression = ws_sold_date_sk#11 IN dynamicpruning#8

Subquery:3 Hosting operator id = 18 Hosting Expression = cs_sold_date_sk#13 IN dynamicpruning#8


