== Physical Plan ==
TakeOrderedAndProject (51)
+- * HashAggregate (50)
   +- Exchange (49)
      +- * HashAggregate (48)
         +- * Project (47)
            +- * SortMergeJoin Inner (46)
               :- * Sort (40)
               :  +- Exchange (39)
               :     +- * Project (38)
               :        +- * BroadcastHashJoin Inner BuildRight (37)
               :           :- * Project (31)
               :           :  +- * Filter (30)
               :           :     +- * SortMergeJoin ExistenceJoin(exists#1) (29)
               :           :        :- * SortMergeJoin ExistenceJoin(exists#2) (21)
               :           :        :  :- * SortMergeJoin LeftSemi (13)
               :           :        :  :  :- * Sort (5)
               :           :        :  :  :  +- Exchange (4)
               :           :        :  :  :     +- * Filter (3)
               :           :        :  :  :        +- * ColumnarToRow (2)
               :           :        :  :  :           +- Scan parquet spark_catalog.default.customer (1)
               :           :        :  :  +- * Sort (12)
               :           :        :  :     +- Exchange (11)
               :           :        :  :        +- * Project (10)
               :           :        :  :           +- * BroadcastHashJoin Inner BuildRight (9)
               :           :        :  :              :- * ColumnarToRow (7)
               :           :        :  :              :  +- Scan parquet spark_catalog.default.store_sales (6)
               :           :        :  :              +- ReusedExchange (8)
               :           :        :  +- * Sort (20)
               :           :        :     +- Exchange (19)
               :           :        :        +- * Project (18)
               :           :        :           +- * BroadcastHashJoin Inner BuildRight (17)
               :           :        :              :- * ColumnarToRow (15)
               :           :        :              :  +- Scan parquet spark_catalog.default.web_sales (14)
               :           :        :              +- ReusedExchange (16)
               :           :        +- * Sort (28)
               :           :           +- Exchange (27)
               :           :              +- * Project (26)
               :           :                 +- * BroadcastHashJoin Inner BuildRight (25)
               :           :                    :- * ColumnarToRow (23)
               :           :                    :  +- Scan parquet spark_catalog.default.catalog_sales (22)
               :           :                    +- ReusedExchange (24)
               :           +- BroadcastExchange (36)
               :              +- * Project (35)
               :                 +- * Filter (34)
               :                    +- * ColumnarToRow (33)
               :                       +- Scan parquet spark_catalog.default.customer_address (32)
               +- * Sort (45)
                  +- Exchange (44)
                     +- * Filter (43)
                        +- * ColumnarToRow (42)
                           +- Scan parquet spark_catalog.default.customer_demographics (41)


(1) Scan 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) ColumnarToRow [codegen id : 1]
Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]

(3) Filter [codegen id : 1]
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)) AND might_contain(Subquery scalar-subquery#6, [id=#1], xxhash64(c_current_addr_sk#5, 42)))

(4) Exchange
Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
Arguments: hashpartitioning(c_customer_sk#3, 5), ENSURE_REQUIREMENTS, [plan_id=2]

(5) Sort [codegen id : 2]
Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0

(6) Scan parquet spark_catalog.default.store_sales
Output [2]: [ss_customer_sk#7, ss_sold_date_sk#8]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)]
ReadSchema: struct<ss_customer_sk:int>

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

(8) ReusedExchange [Reuses operator id: 63]
Output [1]: [d_date_sk#10]

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

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

(11) Exchange
Input [1]: [ss_customer_sk#7]
Arguments: hashpartitioning(ss_customer_sk#7, 5), ENSURE_REQUIREMENTS, [plan_id=3]

(12) Sort [codegen id : 5]
Input [1]: [ss_customer_sk#7]
Arguments: [ss_customer_sk#7 ASC NULLS FIRST], false, 0

(13) SortMergeJoin [codegen id : 6]
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [ss_customer_sk#7]
Join type: LeftSemi
Join condition: None

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

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

(16) ReusedExchange [Reuses operator id: 63]
Output [1]: [d_date_sk#13]

(17) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [ws_sold_date_sk#12]
Right keys [1]: [d_date_sk#13]
Join type: Inner
Join condition: None

(18) Project [codegen id : 8]
Output [1]: [ws_bill_customer_sk#11]
Input [3]: [ws_bill_customer_sk#11, ws_sold_date_sk#12, d_date_sk#13]

(19) Exchange
Input [1]: [ws_bill_customer_sk#11]
Arguments: hashpartitioning(ws_bill_customer_sk#11, 5), ENSURE_REQUIREMENTS, [plan_id=4]

(20) Sort [codegen id : 9]
Input [1]: [ws_bill_customer_sk#11]
Arguments: [ws_bill_customer_sk#11 ASC NULLS FIRST], false, 0

(21) SortMergeJoin [codegen id : 10]
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [ws_bill_customer_sk#11]
Join type: ExistenceJoin(exists#2)
Join condition: None

(22) Scan 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#9)]
ReadSchema: struct<cs_ship_customer_sk:int>

(23) ColumnarToRow [codegen id : 12]
Input [2]: [cs_ship_customer_sk#14, cs_sold_date_sk#15]

(24) ReusedExchange [Reuses operator id: 63]
Output [1]: [d_date_sk#16]

(25) BroadcastHashJoin [codegen id : 12]
Left keys [1]: [cs_sold_date_sk#15]
Right keys [1]: [d_date_sk#16]
Join type: Inner
Join condition: None

(26) Project [codegen id : 12]
Output [1]: [cs_ship_customer_sk#14]
Input [3]: [cs_ship_customer_sk#14, cs_sold_date_sk#15, d_date_sk#16]

(27) Exchange
Input [1]: [cs_ship_customer_sk#14]
Arguments: hashpartitioning(cs_ship_customer_sk#14, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(28) Sort [codegen id : 13]
Input [1]: [cs_ship_customer_sk#14]
Arguments: [cs_ship_customer_sk#14 ASC NULLS FIRST], false, 0

(29) SortMergeJoin [codegen id : 15]
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [cs_ship_customer_sk#14]
Join type: ExistenceJoin(exists#1)
Join condition: None

(30) Filter [codegen id : 15]
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)

(31) Project [codegen id : 15]
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]

(32) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#17, ca_county#18]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_county, [Dona Ana County,Jefferson County,La Porte County,Rush County,Toole County]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_county:string>

(33) ColumnarToRow [codegen id : 14]
Input [2]: [ca_address_sk#17, ca_county#18]

(34) Filter [codegen id : 14]
Input [2]: [ca_address_sk#17, ca_county#18]
Condition : (ca_county#18 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#17))

(35) Project [codegen id : 14]
Output [1]: [ca_address_sk#17]
Input [2]: [ca_address_sk#17, ca_county#18]

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

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

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

(39) Exchange
Input [1]: [c_current_cdemo_sk#4]
Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), ENSURE_REQUIREMENTS, [plan_id=7]

(40) Sort [codegen id : 16]
Input [1]: [c_current_cdemo_sk#4]
Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0

(41) Scan parquet spark_catalog.default.customer_demographics
Output [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#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_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>

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

(43) Filter [codegen id : 17]
Input [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Condition : isnotnull(cd_demo_sk#19)

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

(45) Sort [codegen id : 18]
Input [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
Arguments: [cd_demo_sk#19 ASC NULLS FIRST], false, 0

(46) SortMergeJoin [codegen id : 19]
Left keys [1]: [c_current_cdemo_sk#4]
Right keys [1]: [cd_demo_sk#19]
Join type: Inner
Join condition: None

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

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

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

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

(51) TakeOrderedAndProject
Input [14]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cnt1#31, cd_purchase_estimate#23, cnt2#32, cd_credit_rating#24, cnt3#33, cd_dep_count#25, cnt4#34, cd_dep_employed_count#26, cnt5#35, cd_dep_college_count#27, cnt6#36]
Arguments: 100, [cd_gender#20 ASC NULLS FIRST, cd_marital_status#21 ASC NULLS FIRST, cd_education_status#22 ASC NULLS FIRST, cd_purchase_estimate#23 ASC NULLS FIRST, cd_credit_rating#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], [cd_gender#20, cd_marital_status#21, cd_education_status#22, cnt1#31, cd_purchase_estimate#23, cnt2#32, cd_credit_rating#24, cnt3#33, cd_dep_count#25, cnt4#34, cd_dep_employed_count#26, cnt5#35, cd_dep_college_count#27, cnt6#36]

===== Subqueries =====

Subquery:1 Hosting operator id = 3 Hosting Expression = Subquery scalar-subquery#6, [id=#1]
ObjectHashAggregate (58)
+- Exchange (57)
   +- ObjectHashAggregate (56)
      +- * Project (55)
         +- * Filter (54)
            +- * ColumnarToRow (53)
               +- Scan parquet spark_catalog.default.customer_address (52)


(52) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#17, ca_county#18]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_county, [Dona Ana County,Jefferson County,La Porte County,Rush County,Toole County]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_county:string>

(53) ColumnarToRow [codegen id : 1]
Input [2]: [ca_address_sk#17, ca_county#18]

(54) Filter [codegen id : 1]
Input [2]: [ca_address_sk#17, ca_county#18]
Condition : (ca_county#18 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#17))

(55) Project [codegen id : 1]
Output [1]: [ca_address_sk#17]
Input [2]: [ca_address_sk#17, ca_county#18]

(56) ObjectHashAggregate
Input [1]: [ca_address_sk#17]
Keys: []
Functions [1]: [partial_bloom_filter_agg(xxhash64(ca_address_sk#17, 42), 2555, 57765, 0, 0)]
Aggregate Attributes [1]: [buf#37]
Results [1]: [buf#38]

(57) Exchange
Input [1]: [buf#38]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=10]

(58) ObjectHashAggregate
Input [1]: [buf#38]
Keys: []
Functions [1]: [bloom_filter_agg(xxhash64(ca_address_sk#17, 42), 2555, 57765, 0, 0)]
Aggregate Attributes [1]: [bloom_filter_agg(xxhash64(ca_address_sk#17, 42), 2555, 57765, 0, 0)#39]
Results [1]: [bloom_filter_agg(xxhash64(ca_address_sk#17, 42), 2555, 57765, 0, 0)#39 AS bloomFilter#40]

Subquery:2 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9
BroadcastExchange (63)
+- * Project (62)
   +- * Filter (61)
      +- * ColumnarToRow (60)
         +- Scan parquet spark_catalog.default.date_dim (59)


(59) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#10, d_year#41, d_moy#42]
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,1), LessThanOrEqual(d_moy,4), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(60) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#10, d_year#41, d_moy#42]

(61) Filter [codegen id : 1]
Input [3]: [d_date_sk#10, d_year#41, d_moy#42]
Condition : (((((isnotnull(d_year#41) AND isnotnull(d_moy#42)) AND (d_year#41 = 2002)) AND (d_moy#42 >= 1)) AND (d_moy#42 <= 4)) AND isnotnull(d_date_sk#10))

(62) Project [codegen id : 1]
Output [1]: [d_date_sk#10]
Input [3]: [d_date_sk#10, d_year#41, d_moy#42]

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

Subquery:3 Hosting operator id = 14 Hosting Expression = ws_sold_date_sk#12 IN dynamicpruning#9

Subquery:4 Hosting operator id = 22 Hosting Expression = cs_sold_date_sk#15 IN dynamicpruning#9


