== 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_qoy#9]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,1999), LessThan(d_qoy,4), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_qoy:int>

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

(6) CometProject
Input [3]: [d_date_sk#7, d_year#8, d_qoy#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: [customsk#14], [ws_bill_customer_sk#10 AS customsk#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: [customsk#19], [cs_ship_customer_sk#15 AS customsk#19]

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

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

(22) CometBroadcastHashJoin
Left output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Right output [1]: [customsk#14]
Arguments: [c_customer_sk#1], [customsk#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_state#21]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string>

(25) CometFilter
Input [2]: [ca_address_sk#20, ca_state#21]
Condition : isnotnull(ca_address_sk#20)

(26) CometProject
Input [2]: [ca_address_sk#20, ca_state#21]
Arguments: [ca_address_sk#20, ca_state#22], [ca_address_sk#20, static_invoke(CharVarcharCodegenUtils.readSidePadding(ca_state#21, 2)) AS ca_state#22]

(27) CometBroadcastExchange
Input [2]: [ca_address_sk#20, ca_state#22]
Arguments: [ca_address_sk#20, ca_state#22]

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

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

(30) CometScan [native_iceberg_compat] parquet spark_catalog.default.customer_demographics
Output [6]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#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_dep_count:int,cd_dep_employed_count:int,cd_dep_college_count:int>

(31) CometFilter
Input [6]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Condition : isnotnull(cd_demo_sk#23)

(32) CometProject
Input [6]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Arguments: [cd_demo_sk#23, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28], [cd_demo_sk#23, static_invoke(CharVarcharCodegenUtils.readSidePadding(cd_gender#24, 1)) AS cd_gender#29, static_invoke(CharVarcharCodegenUtils.readSidePadding(cd_marital_status#25, 1)) AS cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]

(33) CometBroadcastExchange
Input [6]: [cd_demo_sk#23, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Arguments: [cd_demo_sk#23, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]

(34) CometBroadcastHashJoin
Left output [2]: [c_current_cdemo_sk#2, ca_state#22]
Right output [6]: [cd_demo_sk#23, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Arguments: [c_current_cdemo_sk#2], [cd_demo_sk#23], Inner, BuildRight

(35) CometProject
Input [8]: [c_current_cdemo_sk#2, ca_state#22, cd_demo_sk#23, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Arguments: [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28], [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]

(36) CometHashAggregate
Input [6]: [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Keys [6]: [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Functions [10]: [partial_count(1), partial_avg(cd_dep_count#26), partial_max(cd_dep_count#26), partial_sum(cd_dep_count#26), partial_avg(cd_dep_employed_count#27), partial_max(cd_dep_employed_count#27), partial_sum(cd_dep_employed_count#27), partial_avg(cd_dep_college_count#28), partial_max(cd_dep_college_count#28), partial_sum(cd_dep_college_count#28)]

(37) CometExchange
Input [19]: [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, count#31, sum#32, count#33, max#34, sum#35, sum#36, count#37, max#38, sum#39, sum#40, count#41, max#42, sum#43]
Arguments: hashpartitioning(ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]

(38) CometHashAggregate
Input [19]: [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, count#31, sum#32, count#33, max#34, sum#35, sum#36, count#37, max#38, sum#39, sum#40, count#41, max#42, sum#43]
Keys [6]: [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
Functions [10]: [count(1), avg(cd_dep_count#26), max(cd_dep_count#26), sum(cd_dep_count#26), avg(cd_dep_employed_count#27), max(cd_dep_employed_count#27), sum(cd_dep_employed_count#27), avg(cd_dep_college_count#28), max(cd_dep_college_count#28), sum(cd_dep_college_count#28)]

(39) CometTakeOrderedAndProject
Input [18]: [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cnt1#44, avg(cd_dep_count)#45, max(cd_dep_count)#46, sum(cd_dep_count)#47, cd_dep_employed_count#27, cnt2#48, avg(cd_dep_employed_count)#49, max(cd_dep_employed_count)#50, sum(cd_dep_employed_count)#51, cd_dep_college_count#28, cnt3#52, avg(cd_dep_college_count)#53, max(cd_dep_college_count)#54, sum(cd_dep_college_count)#55]
Arguments: TakeOrderedAndProject(limit=100, orderBy=[ca_state#22 ASC NULLS FIRST,cd_gender#29 ASC NULLS FIRST,cd_marital_status#30 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], output=[ca_state#22,cd_gender#29,cd_marital_status#30,cd_dep_count#26,cnt1#44,avg(cd_dep_count)#45,max(cd_dep_count)#46,sum(cd_dep_count)#47,cd_dep_employed_count#27,cnt2#48,avg(cd_dep_employed_count)#49,max(cd_dep_employed_count)#50,sum(cd_dep_employed_count)#51,cd_dep_college_count#28,cnt3#52,avg(cd_dep_college_count)#53,max(cd_dep_college_count)#54,sum(cd_dep_college_count)#55]), [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cnt1#44, avg(cd_dep_count)#45, max(cd_dep_count)#46, sum(cd_dep_count)#47, cd_dep_employed_count#27, cnt2#48, avg(cd_dep_employed_count)#49, max(cd_dep_employed_count)#50, sum(cd_dep_employed_count)#51, cd_dep_college_count#28, cnt3#52, avg(cd_dep_college_count)#53, max(cd_dep_college_count)#54, sum(cd_dep_college_count)#55], 100, 0, [ca_state#22 ASC NULLS FIRST, cd_gender#29 ASC NULLS FIRST, cd_marital_status#30 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], [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cnt1#44, avg(cd_dep_count)#45, max(cd_dep_count)#46, sum(cd_dep_count)#47, cd_dep_employed_count#27, cnt2#48, avg(cd_dep_employed_count)#49, max(cd_dep_employed_count)#50, sum(cd_dep_employed_count)#51, cd_dep_college_count#28, cnt3#52, avg(cd_dep_college_count)#53, max(cd_dep_college_count)#54, sum(cd_dep_college_count)#55]

(40) CometColumnarToRow [codegen id : 1]
Input [18]: [ca_state#22, cd_gender#29, cd_marital_status#30, cd_dep_count#26, cnt1#44, avg(cd_dep_count)#45, max(cd_dep_count)#46, sum(cd_dep_count)#47, cd_dep_employed_count#27, cnt2#48, avg(cd_dep_employed_count)#49, max(cd_dep_employed_count)#50, sum(cd_dep_employed_count)#51, cd_dep_college_count#28, cnt3#52, avg(cd_dep_college_count)#53, max(cd_dep_college_count)#54, sum(cd_dep_college_count)#55]

===== 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_qoy#9]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,1999), LessThan(d_qoy,4), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_qoy:int>

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

(43) CometProject
Input [3]: [d_date_sk#7, d_year#8, d_qoy#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


