== 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#7]

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

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

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

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

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

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

(20) CometUnion
Child 0 Input [1]: [customer_sk#13]
Child 1 Input [1]: [customer_sk#18]

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

(22) CometBroadcastHashJoin
Left output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Right output [1]: [customer_sk#13]
Arguments: [c_customer_sk#1], [customer_sk#13], 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#19, ca_county#20]
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#19, ca_county#20]
Condition : (ca_county#20 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#19))

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

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

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

(29) CometProject
Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#19]
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#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29]
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#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29]
Condition : isnotnull(cd_demo_sk#21)

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

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

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

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

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

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

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

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

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

===== 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#15 IN dynamicpruning#6


