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


(1) CometScan [native_iceberg_compat] 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) CometScan [native_iceberg_compat] 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>

(4) CometScan [native_iceberg_compat] parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#9, d_year#10, d_moy#11]
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>

(5) CometFilter
Input [3]: [d_date_sk#9, d_year#10, d_moy#11]
Condition : (((((isnotnull(d_year#10) AND isnotnull(d_moy#11)) AND (d_year#10 = 2002)) AND (d_moy#11 >= 1)) AND (d_moy#11 <= 4)) AND isnotnull(d_date_sk#9))

(6) CometProject
Input [3]: [d_date_sk#9, d_year#10, d_moy#11]
Arguments: [d_date_sk#9], [d_date_sk#9]

(7) CometBroadcastExchange
Input [1]: [d_date_sk#9]
Arguments: [d_date_sk#9]

(8) CometBroadcastHashJoin
Left output [2]: [ss_customer_sk#6, ss_sold_date_sk#7]
Right output [1]: [d_date_sk#9]
Arguments: [ss_sold_date_sk#7], [d_date_sk#9], Inner, BuildRight

(9) CometProject
Input [3]: [ss_customer_sk#6, ss_sold_date_sk#7, d_date_sk#9]
Arguments: [ss_customer_sk#6], [ss_customer_sk#6]

(10) CometBroadcastExchange
Input [1]: [ss_customer_sk#6]
Arguments: [ss_customer_sk#6]

(11) CometBroadcastHashJoin
Left output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
Right output [1]: [ss_customer_sk#6]
Arguments: [c_customer_sk#3], [ss_customer_sk#6], LeftSemi, BuildRight

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

(13) CometScan [native_iceberg_compat] parquet spark_catalog.default.web_sales
Output [2]: [ws_bill_customer_sk#12, ws_sold_date_sk#13]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#13), dynamicpruningexpression(ws_sold_date_sk#13 IN dynamicpruning#14)]
ReadSchema: struct<ws_bill_customer_sk:int>

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

(15) CometBroadcastHashJoin
Left output [2]: [ws_bill_customer_sk#12, ws_sold_date_sk#13]
Right output [1]: [d_date_sk#9]
Arguments: [ws_sold_date_sk#13], [d_date_sk#9], Inner, BuildRight

(16) CometProject
Input [3]: [ws_bill_customer_sk#12, ws_sold_date_sk#13, d_date_sk#9]
Arguments: [ws_bill_customer_sk#12], [ws_bill_customer_sk#12]

(17) CometColumnarToRow [codegen id : 1]
Input [1]: [ws_bill_customer_sk#12]

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

(19) BroadcastHashJoin [codegen id : 5]
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [ws_bill_customer_sk#12]
Join type: ExistenceJoin(exists#2)
Join condition: None

(20) CometScan [native_iceberg_compat] parquet spark_catalog.default.catalog_sales
Output [2]: [cs_ship_customer_sk#15, cs_sold_date_sk#16]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#16), dynamicpruningexpression(cs_sold_date_sk#16 IN dynamicpruning#17)]
ReadSchema: struct<cs_ship_customer_sk:int>

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

(22) CometBroadcastHashJoin
Left output [2]: [cs_ship_customer_sk#15, cs_sold_date_sk#16]
Right output [1]: [d_date_sk#9]
Arguments: [cs_sold_date_sk#16], [d_date_sk#9], Inner, BuildRight

(23) CometProject
Input [3]: [cs_ship_customer_sk#15, cs_sold_date_sk#16, d_date_sk#9]
Arguments: [cs_ship_customer_sk#15], [cs_ship_customer_sk#15]

(24) CometColumnarToRow [codegen id : 2]
Input [1]: [cs_ship_customer_sk#15]

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

(26) BroadcastHashJoin [codegen id : 5]
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [cs_ship_customer_sk#15]
Join type: ExistenceJoin(exists#1)
Join condition: None

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

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

(29) CometScan [native_iceberg_compat] parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#18, ca_county#19]
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>

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

(31) CometProject
Input [2]: [ca_address_sk#18, ca_county#19]
Arguments: [ca_address_sk#18], [ca_address_sk#18]

(32) CometColumnarToRow [codegen id : 3]
Input [1]: [ca_address_sk#18]

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

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

(35) Project [codegen id : 5]
Output [1]: [c_current_cdemo_sk#4]
Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#18]

(36) CometScan [native_iceberg_compat] parquet spark_catalog.default.customer_demographics
Output [9]: [cd_demo_sk#20, cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
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>

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

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

(39) CometColumnarToRow [codegen id : 4]
Input [9]: [cd_demo_sk#20, cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]

(40) BroadcastExchange
Input [9]: [cd_demo_sk#20, cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]

(41) BroadcastHashJoin [codegen id : 5]
Left keys [1]: [c_current_cdemo_sk#4]
Right keys [1]: [cd_demo_sk#20]
Join type: Inner
Join condition: None

(42) Project [codegen id : 5]
Output [8]: [cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#20, cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]

(43) HashAggregate [codegen id : 5]
Input [8]: [cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Keys [8]: [cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#33]
Results [9]: [cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, count#34]

(44) CometColumnarExchange
Input [9]: [cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, count#34]
Arguments: hashpartitioning(cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=5]

(45) CometColumnarToRow [codegen id : 6]
Input [9]: [cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, count#34]

(46) HashAggregate [codegen id : 6]
Input [9]: [cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, count#34]
Keys [8]: [cd_gender#29, cd_marital_status#30, cd_education_status#31, cd_purchase_estimate#24, cd_credit_rating#32, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#35]
Results [14]: [cd_gender#29, cd_marital_status#30, cd_education_status#31, count(1)#35 AS cnt1#36, cd_purchase_estimate#24, count(1)#35 AS cnt2#37, cd_credit_rating#32, count(1)#35 AS cnt3#38, cd_dep_count#26, count(1)#35 AS cnt4#39, cd_dep_employed_count#27, count(1)#35 AS cnt5#40, cd_dep_college_count#28, count(1)#35 AS cnt6#41]

(47) TakeOrderedAndProject
Input [14]: [cd_gender#29, cd_marital_status#30, cd_education_status#31, cnt1#36, cd_purchase_estimate#24, cnt2#37, cd_credit_rating#32, cnt3#38, cd_dep_count#26, cnt4#39, cd_dep_employed_count#27, cnt5#40, cd_dep_college_count#28, cnt6#41]
Arguments: 100, [cd_gender#29 ASC NULLS FIRST, cd_marital_status#30 ASC NULLS FIRST, cd_education_status#31 ASC NULLS FIRST, cd_purchase_estimate#24 ASC NULLS FIRST, cd_credit_rating#32 ASC NULLS FIRST, cd_dep_count#26 ASC NULLS FIRST, cd_dep_employed_count#27 ASC NULLS FIRST, cd_dep_college_count#28 ASC NULLS FIRST], [cd_gender#29, cd_marital_status#30, cd_education_status#31, cnt1#36, cd_purchase_estimate#24, cnt2#37, cd_credit_rating#32, cnt3#38, cd_dep_count#26, cnt4#39, cd_dep_employed_count#27, cnt5#40, cd_dep_college_count#28, cnt6#41]

===== Subqueries =====

Subquery:1 Hosting operator id = 3 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8
BroadcastExchange (52)
+- * CometColumnarToRow (51)
   +- CometProject (50)
      +- CometFilter (49)
         +- CometScan [native_iceberg_compat] parquet spark_catalog.default.date_dim (48)


(48) CometScan [native_iceberg_compat] parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#9, d_year#10, d_moy#11]
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>

(49) CometFilter
Input [3]: [d_date_sk#9, d_year#10, d_moy#11]
Condition : (((((isnotnull(d_year#10) AND isnotnull(d_moy#11)) AND (d_year#10 = 2002)) AND (d_moy#11 >= 1)) AND (d_moy#11 <= 4)) AND isnotnull(d_date_sk#9))

(50) CometProject
Input [3]: [d_date_sk#9, d_year#10, d_moy#11]
Arguments: [d_date_sk#9], [d_date_sk#9]

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

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

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

Subquery:3 Hosting operator id = 20 Hosting Expression = cs_sold_date_sk#16 IN dynamicpruning#8


