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


(1) CometNativeScan 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) CometColumnarToRow [codegen id : 9]
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]

(4) Scan 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>

(5) ColumnarToRow [codegen id : 2]
Input [2]: [ss_customer_sk#4, ss_sold_date_sk#5]

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

(7) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [ss_sold_date_sk#5]
Right keys [1]: [d_date_sk#7]
Join type: Inner
Join condition: None

(8) Project [codegen id : 2]
Output [1]: [ss_customer_sk#4]
Input [3]: [ss_customer_sk#4, ss_sold_date_sk#5, d_date_sk#7]

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

(10) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [ss_customer_sk#4]
Join type: LeftSemi
Join condition: None

(11) Scan parquet spark_catalog.default.web_sales
Output [2]: [ws_bill_customer_sk#8, ws_sold_date_sk#9]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#9), dynamicpruningexpression(ws_sold_date_sk#9 IN dynamicpruning#6)]
ReadSchema: struct<ws_bill_customer_sk:int>

(12) ColumnarToRow [codegen id : 4]
Input [2]: [ws_bill_customer_sk#8, ws_sold_date_sk#9]

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

(14) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [ws_sold_date_sk#9]
Right keys [1]: [d_date_sk#10]
Join type: Inner
Join condition: None

(15) Project [codegen id : 4]
Output [1]: [ws_bill_customer_sk#8]
Input [3]: [ws_bill_customer_sk#8, ws_sold_date_sk#9, d_date_sk#10]

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

(17) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [ws_bill_customer_sk#8]
Join type: LeftAnti
Join condition: None

(18) Scan parquet spark_catalog.default.catalog_sales
Output [2]: [cs_ship_customer_sk#11, cs_sold_date_sk#12]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#12), dynamicpruningexpression(cs_sold_date_sk#12 IN dynamicpruning#6)]
ReadSchema: struct<cs_ship_customer_sk:int>

(19) ColumnarToRow [codegen id : 6]
Input [2]: [cs_ship_customer_sk#11, cs_sold_date_sk#12]

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

(21) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [cs_sold_date_sk#12]
Right keys [1]: [d_date_sk#13]
Join type: Inner
Join condition: None

(22) Project [codegen id : 6]
Output [1]: [cs_ship_customer_sk#11]
Input [3]: [cs_ship_customer_sk#11, cs_sold_date_sk#12, d_date_sk#13]

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

(24) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [cs_ship_customer_sk#11]
Join type: LeftAnti
Join condition: None

(25) Project [codegen id : 9]
Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3]
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]

(26) CometNativeScan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#14, ca_state#15]
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>

(27) CometFilter
Input [2]: [ca_address_sk#14, ca_state#15]
Condition : (static_invoke(CharVarcharCodegenUtils.readSidePadding(ca_state#15, 2)) IN (KY,GA,NM) AND isnotnull(ca_address_sk#14))

(28) CometProject
Input [2]: [ca_address_sk#14, ca_state#15]
Arguments: [ca_address_sk#14], [ca_address_sk#14]

(29) CometColumnarToRow [codegen id : 7]
Input [1]: [ca_address_sk#14]

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

(31) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_current_addr_sk#3]
Right keys [1]: [ca_address_sk#14]
Join type: Inner
Join condition: None

(32) Project [codegen id : 9]
Output [1]: [c_current_cdemo_sk#2]
Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#14]

(33) CometNativeScan parquet spark_catalog.default.customer_demographics
Output [6]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21]
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>

(34) CometFilter
Input [6]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21]
Condition : isnotnull(cd_demo_sk#16)

(35) CometProject
Input [6]: [cd_demo_sk#16, cd_gender#17, cd_marital_status#18, cd_education_status#19, cd_purchase_estimate#20, cd_credit_rating#21]
Arguments: [cd_demo_sk#16, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25], [cd_demo_sk#16, static_invoke(CharVarcharCodegenUtils.readSidePadding(cd_gender#17, 1)) AS cd_gender#22, static_invoke(CharVarcharCodegenUtils.readSidePadding(cd_marital_status#18, 1)) AS cd_marital_status#23, static_invoke(CharVarcharCodegenUtils.readSidePadding(cd_education_status#19, 20)) AS cd_education_status#24, cd_purchase_estimate#20, static_invoke(CharVarcharCodegenUtils.readSidePadding(cd_credit_rating#21, 10)) AS cd_credit_rating#25]

(36) CometColumnarToRow [codegen id : 8]
Input [6]: [cd_demo_sk#16, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25]

(37) BroadcastExchange
Input [6]: [cd_demo_sk#16, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]

(38) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [c_current_cdemo_sk#2]
Right keys [1]: [cd_demo_sk#16]
Join type: Inner
Join condition: None

(39) Project [codegen id : 9]
Output [5]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25]
Input [7]: [c_current_cdemo_sk#2, cd_demo_sk#16, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25]

(40) HashAggregate [codegen id : 9]
Input [5]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25]
Keys [5]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#26]
Results [6]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25, count#27]

(41) CometColumnarExchange
Input [6]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25, count#27]
Arguments: hashpartitioning(cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=6]

(42) CometColumnarToRow [codegen id : 10]
Input [6]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25, count#27]

(43) HashAggregate [codegen id : 10]
Input [6]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25, count#27]
Keys [5]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#20, cd_credit_rating#25]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#28]
Results [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, count(1)#28 AS cnt1#29, cd_purchase_estimate#20, count(1)#28 AS cnt2#30, cd_credit_rating#25, count(1)#28 AS cnt3#31]

(44) TakeOrderedAndProject
Input [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cnt1#29, cd_purchase_estimate#20, cnt2#30, cd_credit_rating#25, cnt3#31]
Arguments: 100, [cd_gender#22 ASC NULLS FIRST, cd_marital_status#23 ASC NULLS FIRST, cd_education_status#24 ASC NULLS FIRST, cd_purchase_estimate#20 ASC NULLS FIRST, cd_credit_rating#25 ASC NULLS FIRST], [cd_gender#22, cd_marital_status#23, cd_education_status#24, cnt1#29, cd_purchase_estimate#20, cnt2#30, cd_credit_rating#25, cnt3#31]

===== Subqueries =====

Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6
BroadcastExchange (49)
+- * CometColumnarToRow (48)
   +- CometProject (47)
      +- CometFilter (46)
         +- CometNativeScan parquet spark_catalog.default.date_dim (45)


(45) CometNativeScan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#7, d_year#32, d_moy#33]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,6), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(46) CometFilter
Input [3]: [d_date_sk#7, d_year#32, d_moy#33]
Condition : (((((isnotnull(d_year#32) AND isnotnull(d_moy#33)) AND (d_year#32 = 2001)) AND (d_moy#33 >= 4)) AND (d_moy#33 <= 6)) AND isnotnull(d_date_sk#7))

(47) CometProject
Input [3]: [d_date_sk#7, d_year#32, d_moy#33]
Arguments: [d_date_sk#7], [d_date_sk#7]

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

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

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

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


