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


(1) CometNativeScan: `spark_catalog`.`default`.`customer`
Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
Arguments: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]

(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) CometNativeScan: `spark_catalog`.`default`.`store_sales`
Output [2]: [ss_customer_sk#6, ss_sold_date_sk#7]
Arguments: [ss_customer_sk#6, ss_sold_date_sk#7]

(4) CometNativeScan: `spark_catalog`.`default`.`date_dim`
Output [3]: [d_date_sk#8, d_year#9, d_moy#10]
Arguments: [d_date_sk#8, d_year#9, d_moy#10]

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

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

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

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

(9) CometProject
Input [3]: [ss_customer_sk#6, ss_sold_date_sk#7, d_date_sk#8]
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) ColumnarToRow [codegen id : 5]
Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]

(13) CometNativeScan: `spark_catalog`.`default`.`web_sales`
Output [2]: [ws_bill_customer_sk#11, ws_sold_date_sk#12]
Arguments: [ws_bill_customer_sk#11, ws_sold_date_sk#12]

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

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

(16) CometProject
Input [3]: [ws_bill_customer_sk#11, ws_sold_date_sk#12, d_date_sk#13]
Arguments: [ws_bill_customer_sk#11], [ws_bill_customer_sk#11]

(17) ColumnarToRow [codegen id : 1]
Input [1]: [ws_bill_customer_sk#11]

(18) BroadcastExchange
Input [1]: [ws_bill_customer_sk#11]
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#11]
Join type: ExistenceJoin(exists#2)
Join condition: None

(20) ReusedExchange [Reuses operator id: 18]
Output [1]: [cs_ship_customer_sk#14]

(21) BroadcastHashJoin [codegen id : 5]
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [cs_ship_customer_sk#14]
Join type: ExistenceJoin(exists#1)
Join condition: None

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

(23) 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]

(24) CometNativeScan: `spark_catalog`.`default`.`customer_address`
Output [2]: [ca_address_sk#15, ca_county#16]
Arguments: [ca_address_sk#15, ca_county#16]

(25) CometFilter
Input [2]: [ca_address_sk#15, ca_county#16]
Condition : (ca_county#16 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#15))

(26) CometProject
Input [2]: [ca_address_sk#15, ca_county#16]
Arguments: [ca_address_sk#15], [ca_address_sk#15]

(27) ColumnarToRow [codegen id : 3]
Input [1]: [ca_address_sk#15]

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

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

(30) Project [codegen id : 5]
Output [1]: [c_current_cdemo_sk#4]
Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#15]

(31) CometNativeScan: `spark_catalog`.`default`.`customer_demographics`
Output [9]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25]
Arguments: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25]

(32) CometFilter
Input [9]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25]
Condition : isnotnull(cd_demo_sk#17)

(33) ColumnarToRow [codegen id : 4]
Input [9]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25]

(34) BroadcastExchange
Input [9]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]

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

(36) Project [codegen id : 5]
Output [8]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25]
Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25]

(37) HashAggregate [codegen id : 5]
Input [8]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25]
Keys [8]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#26]
Results [9]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25, count#27]

(38) Exchange
Input [9]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25, count#27]
Arguments: hashpartitioning(cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25, 5), ENSURE_REQUIREMENTS, [plan_id=4]

(39) HashAggregate [codegen id : 6]
Input [9]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25, count#27]
Keys [8]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, cd_dep_count#23, cd_dep_employed_count#24, cd_dep_college_count#25]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#28]
Results [14]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, count(1)#28 AS cnt1#29, cd_purchase_estimate#21, count(1)#28 AS cnt2#30, cd_credit_rating#22, count(1)#28 AS cnt3#31, cd_dep_count#23, count(1)#28 AS cnt4#32, cd_dep_employed_count#24, count(1)#28 AS cnt5#33, cd_dep_college_count#25, count(1)#28 AS cnt6#34]

(40) TakeOrderedAndProject
Input [14]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cnt1#29, cd_purchase_estimate#21, cnt2#30, cd_credit_rating#22, cnt3#31, cd_dep_count#23, cnt4#32, cd_dep_employed_count#24, cnt5#33, cd_dep_college_count#25, cnt6#34]
Arguments: 100, [cd_gender#18 ASC NULLS FIRST, cd_marital_status#19 ASC NULLS FIRST, cd_education_status#20 ASC NULLS FIRST, cd_purchase_estimate#21 ASC NULLS FIRST, cd_credit_rating#22 ASC NULLS FIRST, cd_dep_count#23 ASC NULLS FIRST, cd_dep_employed_count#24 ASC NULLS FIRST, cd_dep_college_count#25 ASC NULLS FIRST], [cd_gender#18, cd_marital_status#19, cd_education_status#20, cnt1#29, cd_purchase_estimate#21, cnt2#30, cd_credit_rating#22, cnt3#31, cd_dep_count#23, cnt4#32, cd_dep_employed_count#24, cnt5#33, cd_dep_college_count#25, cnt6#34]

