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


(1) CometScan 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 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 parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#9, d_year#10, d_qoy#11]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,2002), 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#9, d_year#10, d_qoy#11]
Condition : ((((isnotnull(d_year#10) AND isnotnull(d_qoy#11)) AND (d_year#10 = 2002)) AND (d_qoy#11 < 4)) AND isnotnull(d_date_sk#9))

(6) CometProject
Input [3]: [d_date_sk#9, d_year#10, d_qoy#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 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#15]

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

(16) CometProject
Input [3]: [ws_bill_customer_sk#12, ws_sold_date_sk#13, d_date_sk#15]
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 parquet spark_catalog.default.catalog_sales
Output [2]: [cs_ship_customer_sk#16, cs_sold_date_sk#17]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#17), dynamicpruningexpression(cs_sold_date_sk#17 IN dynamicpruning#18)]
ReadSchema: struct<cs_ship_customer_sk:int>

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

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

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

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

(25) BroadcastExchange
Input [1]: [cs_ship_customer_sk#16]
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#16]
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 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>

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

(31) CometColumnarToRow [codegen id : 3]
Input [2]: [ca_address_sk#20, ca_state#21]

(32) BroadcastExchange
Input [2]: [ca_address_sk#20, ca_state#21]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]

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

(34) Project [codegen id : 5]
Output [2]: [c_current_cdemo_sk#4, ca_state#21]
Input [4]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#20, ca_state#21]

(35) CometScan parquet spark_catalog.default.customer_demographics
Output [6]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
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>

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

(37) CometColumnarToRow [codegen id : 4]
Input [6]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]

(38) BroadcastExchange
Input [6]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

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

(40) Project [codegen id : 5]
Output [6]: [ca_state#21, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Input [8]: [c_current_cdemo_sk#4, ca_state#21, cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]

(41) HashAggregate [codegen id : 5]
Input [6]: [ca_state#21, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Keys [6]: [ca_state#21, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Functions [10]: [partial_count(1), partial_min(cd_dep_count#25), partial_max(cd_dep_count#25), partial_avg(cd_dep_count#25), partial_min(cd_dep_employed_count#26), partial_max(cd_dep_employed_count#26), partial_avg(cd_dep_employed_count#26), partial_min(cd_dep_college_count#27), partial_max(cd_dep_college_count#27), partial_avg(cd_dep_college_count#27)]
Aggregate Attributes [13]: [count#28, min#29, max#30, sum#31, count#32, min#33, max#34, sum#35, count#36, min#37, max#38, sum#39, count#40]
Results [19]: [ca_state#21, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#41, min#42, max#43, sum#44, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53]

(42) CometColumnarExchange
Input [19]: [ca_state#21, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#41, min#42, max#43, sum#44, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53]
Arguments: hashpartitioning(ca_state#21, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=5]

(43) CometColumnarToRow [codegen id : 6]
Input [19]: [ca_state#21, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#41, min#42, max#43, sum#44, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53]

(44) HashAggregate [codegen id : 6]
Input [19]: [ca_state#21, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#41, min#42, max#43, sum#44, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53]
Keys [6]: [ca_state#21, cd_gender#23, cd_marital_status#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Functions [10]: [count(1), min(cd_dep_count#25), max(cd_dep_count#25), avg(cd_dep_count#25), min(cd_dep_employed_count#26), max(cd_dep_employed_count#26), avg(cd_dep_employed_count#26), min(cd_dep_college_count#27), max(cd_dep_college_count#27), avg(cd_dep_college_count#27)]
Aggregate Attributes [10]: [count(1)#54, min(cd_dep_count#25)#55, max(cd_dep_count#25)#56, avg(cd_dep_count#25)#57, min(cd_dep_employed_count#26)#58, max(cd_dep_employed_count#26)#59, avg(cd_dep_employed_count#26)#60, min(cd_dep_college_count#27)#61, max(cd_dep_college_count#27)#62, avg(cd_dep_college_count#27)#63]
Results [18]: [ca_state#21, cd_gender#23, cd_marital_status#24, count(1)#54 AS cnt1#64, min(cd_dep_count#25)#55 AS min(cd_dep_count)#65, max(cd_dep_count#25)#56 AS max(cd_dep_count)#66, avg(cd_dep_count#25)#57 AS avg(cd_dep_count)#67, cd_dep_employed_count#26, count(1)#54 AS cnt2#68, min(cd_dep_employed_count#26)#58 AS min(cd_dep_employed_count)#69, max(cd_dep_employed_count#26)#59 AS max(cd_dep_employed_count)#70, avg(cd_dep_employed_count#26)#60 AS avg(cd_dep_employed_count)#71, cd_dep_college_count#27, count(1)#54 AS cnt3#72, min(cd_dep_college_count#27)#61 AS min(cd_dep_college_count)#73, max(cd_dep_college_count#27)#62 AS max(cd_dep_college_count)#74, avg(cd_dep_college_count#27)#63 AS avg(cd_dep_college_count)#75, cd_dep_count#25]

(45) TakeOrderedAndProject
Input [18]: [ca_state#21, cd_gender#23, cd_marital_status#24, cnt1#64, min(cd_dep_count)#65, max(cd_dep_count)#66, avg(cd_dep_count)#67, cd_dep_employed_count#26, cnt2#68, min(cd_dep_employed_count)#69, max(cd_dep_employed_count)#70, avg(cd_dep_employed_count)#71, cd_dep_college_count#27, cnt3#72, min(cd_dep_college_count)#73, max(cd_dep_college_count)#74, avg(cd_dep_college_count)#75, cd_dep_count#25]
Arguments: 100, [ca_state#21 ASC NULLS FIRST, cd_gender#23 ASC NULLS FIRST, cd_marital_status#24 ASC NULLS FIRST, cd_dep_count#25 ASC NULLS FIRST, cd_dep_employed_count#26 ASC NULLS FIRST, cd_dep_college_count#27 ASC NULLS FIRST], [ca_state#21, cd_gender#23, cd_marital_status#24, cnt1#64, min(cd_dep_count)#65, max(cd_dep_count)#66, avg(cd_dep_count)#67, cd_dep_employed_count#26, cnt2#68, min(cd_dep_employed_count)#69, max(cd_dep_employed_count)#70, avg(cd_dep_employed_count)#71, cd_dep_college_count#27, cnt3#72, min(cd_dep_college_count)#73, max(cd_dep_college_count)#74, avg(cd_dep_college_count)#75]

===== Subqueries =====

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


(46) CometScan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#9, d_year#10, d_qoy#11]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,2002), LessThan(d_qoy,4), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_qoy:int>

(47) CometFilter
Input [3]: [d_date_sk#9, d_year#10, d_qoy#11]
Condition : ((((isnotnull(d_year#10) AND isnotnull(d_qoy#11)) AND (d_year#10 = 2002)) AND (d_qoy#11 < 4)) AND isnotnull(d_date_sk#9))

(48) CometProject
Input [3]: [d_date_sk#9, d_year#10, d_qoy#11]
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=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#17 IN dynamicpruning#8


