== Physical Plan ==
* CometColumnarToRow (40)
+- CometTakeOrderedAndProject (39)
   +- CometHashAggregate (38)
      +- CometExchange (37)
         +- CometHashAggregate (36)
            +- CometProject (35)
               +- CometBroadcastHashJoin (34)
                  :- CometProject (29)
                  :  +- CometBroadcastHashJoin (28)
                  :     :- CometProject (23)
                  :     :  +- CometBroadcastHashJoin (22)
                  :     :     :- 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)
                  :     :     +- CometBroadcastExchange (21)
                  :     :        +- CometUnion (20)
                  :     :           :- CometProject (15)
                  :     :           :  +- CometBroadcastHashJoin (14)
                  :     :           :     :- CometScan [native_iceberg_compat] parquet spark_catalog.default.web_sales (12)
                  :     :           :     +- ReusedExchange (13)
                  :     :           +- CometProject (19)
                  :     :              +- CometBroadcastHashJoin (18)
                  :     :                 :- CometScan [native_iceberg_compat] parquet spark_catalog.default.catalog_sales (16)
                  :     :                 +- ReusedExchange (17)
                  :     +- CometBroadcastExchange (27)
                  :        +- CometProject (26)
                  :           +- CometFilter (25)
                  :              +- CometScan [native_iceberg_compat] parquet spark_catalog.default.customer_address (24)
                  +- CometBroadcastExchange (33)
                     +- CometProject (32)
                        +- CometFilter (31)
                           +- CometScan [native_iceberg_compat] parquet spark_catalog.default.customer_demographics (30)


(1) CometScan [native_iceberg_compat] 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_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#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Condition : (isnotnull(c_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2))

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

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

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

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

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

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

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

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

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

(12) CometScan [native_iceberg_compat] 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#12)]
ReadSchema: struct<ws_bill_customer_sk:int>

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

(14) CometBroadcastHashJoin
Left output [2]: [ws_bill_customer_sk#10, ws_sold_date_sk#11]
Right output [1]: [d_date_sk#13]
Arguments: [ws_sold_date_sk#11], [d_date_sk#13], Inner, BuildRight

(15) CometProject
Input [3]: [ws_bill_customer_sk#10, ws_sold_date_sk#11, d_date_sk#13]
Arguments: [customer_sk#14], [ws_bill_customer_sk#10 AS customer_sk#14]

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

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

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

(19) CometProject
Input [3]: [cs_ship_customer_sk#15, cs_sold_date_sk#16, d_date_sk#18]
Arguments: [customer_sk#19], [cs_ship_customer_sk#15 AS customer_sk#19]

(20) CometUnion
Child 0 Input [1]: [customer_sk#14]
Child 1 Input [1]: [customer_sk#19]

(21) CometBroadcastExchange
Input [1]: [customer_sk#14]
Arguments: [customer_sk#14]

(22) CometBroadcastHashJoin
Left output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Right output [1]: [customer_sk#14]
Arguments: [c_customer_sk#1], [customer_sk#14], LeftSemi, BuildRight

(23) CometProject
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Arguments: [c_current_cdemo_sk#2, c_current_addr_sk#3], [c_current_cdemo_sk#2, c_current_addr_sk#3]

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

(25) CometFilter
Input [2]: [ca_address_sk#20, ca_county#21]
Condition : (ca_county#21 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#20))

(26) CometProject
Input [2]: [ca_address_sk#20, ca_county#21]
Arguments: [ca_address_sk#20], [ca_address_sk#20]

(27) CometBroadcastExchange
Input [1]: [ca_address_sk#20]
Arguments: [ca_address_sk#20]

(28) CometBroadcastHashJoin
Left output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3]
Right output [1]: [ca_address_sk#20]
Arguments: [c_current_addr_sk#3], [ca_address_sk#20], Inner, BuildRight

(29) CometProject
Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#20]
Arguments: [c_current_cdemo_sk#2], [c_current_cdemo_sk#2]

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

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

(32) CometProject
Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
Arguments: [cd_demo_sk#22, cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30], [cd_demo_sk#22, static_invoke(CharVarcharCodegenUtils.readSidePadding(cd_gender#23, 1)) AS cd_gender#31, static_invoke(CharVarcharCodegenUtils.readSidePadding(cd_marital_status#24, 1)) AS cd_marital_status#32, static_invoke(CharVarcharCodegenUtils.readSidePadding(cd_education_status#25, 20)) AS cd_education_status#33, cd_purchase_estimate#26, static_invoke(CharVarcharCodegenUtils.readSidePadding(cd_credit_rating#27, 10)) AS cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]

(33) CometBroadcastExchange
Input [9]: [cd_demo_sk#22, cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
Arguments: [cd_demo_sk#22, cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]

(34) CometBroadcastHashJoin
Left output [1]: [c_current_cdemo_sk#2]
Right output [9]: [cd_demo_sk#22, cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
Arguments: [c_current_cdemo_sk#2], [cd_demo_sk#22], Inner, BuildRight

(35) CometProject
Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#22, cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
Arguments: [cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30], [cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]

(36) CometHashAggregate
Input [8]: [cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
Keys [8]: [cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
Functions [1]: [partial_count(1)]

(37) CometExchange
Input [9]: [cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#35]
Arguments: hashpartitioning(cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]

(38) CometHashAggregate
Input [9]: [cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#35]
Keys [8]: [cd_gender#31, cd_marital_status#32, cd_education_status#33, cd_purchase_estimate#26, cd_credit_rating#34, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
Functions [1]: [count(1)]

(39) CometTakeOrderedAndProject
Input [14]: [cd_gender#31, cd_marital_status#32, cd_education_status#33, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#34, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_employed_count#29, cnt5#40, cd_dep_college_count#30, cnt6#41]
Arguments: TakeOrderedAndProject(limit=100, orderBy=[cd_gender#31 ASC NULLS FIRST,cd_marital_status#32 ASC NULLS FIRST,cd_education_status#33 ASC NULLS FIRST,cd_purchase_estimate#26 ASC NULLS FIRST,cd_credit_rating#34 ASC NULLS FIRST,cd_dep_count#28 ASC NULLS FIRST,cd_dep_employed_count#29 ASC NULLS FIRST,cd_dep_college_count#30 ASC NULLS FIRST], output=[cd_gender#31,cd_marital_status#32,cd_education_status#33,cnt1#36,cd_purchase_estimate#26,cnt2#37,cd_credit_rating#34,cnt3#38,cd_dep_count#28,cnt4#39,cd_dep_employed_count#29,cnt5#40,cd_dep_college_count#30,cnt6#41]), [cd_gender#31, cd_marital_status#32, cd_education_status#33, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#34, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_employed_count#29, cnt5#40, cd_dep_college_count#30, cnt6#41], 100, 0, [cd_gender#31 ASC NULLS FIRST, cd_marital_status#32 ASC NULLS FIRST, cd_education_status#33 ASC NULLS FIRST, cd_purchase_estimate#26 ASC NULLS FIRST, cd_credit_rating#34 ASC NULLS FIRST, cd_dep_count#28 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [cd_gender#31, cd_marital_status#32, cd_education_status#33, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#34, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_employed_count#29, cnt5#40, cd_dep_college_count#30, cnt6#41]

(40) CometColumnarToRow [codegen id : 1]
Input [14]: [cd_gender#31, cd_marital_status#32, cd_education_status#33, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#34, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_employed_count#29, cnt5#40, cd_dep_college_count#30, cnt6#41]

===== Subqueries =====

Subquery:1 Hosting operator id = 3 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6
BroadcastExchange (45)
+- * CometColumnarToRow (44)
   +- CometProject (43)
      +- CometFilter (42)
         +- CometScan [native_iceberg_compat] parquet spark_catalog.default.date_dim (41)


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

(42) CometFilter
Input [3]: [d_date_sk#7, d_year#8, d_moy#9]
Condition : (((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2002)) AND (d_moy#9 >= 4)) AND (d_moy#9 <= 7)) AND isnotnull(d_date_sk#7))

(43) CometProject
Input [3]: [d_date_sk#7, d_year#8, d_moy#9]
Arguments: [d_date_sk#7], [d_date_sk#7]

(44) CometColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#7]

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

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

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


