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


(1) Scan 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_customer_sk), 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#1, c_current_cdemo_sk#2, c_current_addr_sk#3]

(3) Filter [codegen id : 1]
Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
Condition : (((isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) AND isnotnull(c_current_cdemo_sk#2)) AND might_contain(Subquery scalar-subquery#4, [id=#5], xxhash64(c_current_addr_sk#3, 42)))

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

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

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

(7) ColumnarToRow [codegen id : 4]
Input [2]: [ws_bill_customer_sk#6, ws_sold_date_sk#7]

(8) Filter [codegen id : 4]
Input [2]: [ws_bill_customer_sk#6, ws_sold_date_sk#7]
Condition : isnotnull(ws_bill_customer_sk#6)

(9) ReusedExchange [Reuses operator id: 60]
Output [1]: [d_date_sk#9]

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

(11) Project [codegen id : 4]
Output [1]: [ws_bill_customer_sk#6 AS customer_sk#10]
Input [3]: [ws_bill_customer_sk#6, ws_sold_date_sk#7, d_date_sk#9]

(12) 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#8)]
PushedFilters: [IsNotNull(cs_ship_customer_sk)]
ReadSchema: struct<cs_ship_customer_sk:int>

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

(14) Filter [codegen id : 6]
Input [2]: [cs_ship_customer_sk#11, cs_sold_date_sk#12]
Condition : isnotnull(cs_ship_customer_sk#11)

(15) ReusedExchange [Reuses operator id: 60]
Output [1]: [d_date_sk#13]

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

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

(18) Union

(19) Exchange
Input [1]: [customer_sk#10]
Arguments: hashpartitioning(customer_sk#10, 5), ENSURE_REQUIREMENTS, [plan_id=2]

(20) Sort [codegen id : 7]
Input [1]: [customer_sk#10]
Arguments: [customer_sk#10 ASC NULLS FIRST], false, 0

(21) SortMergeJoin [codegen id : 8]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [customer_sk#10]
Join type: LeftSemi
Join condition: None

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

(23) ColumnarToRow [codegen id : 10]
Input [2]: [ss_customer_sk#15, ss_sold_date_sk#16]

(24) Filter [codegen id : 10]
Input [2]: [ss_customer_sk#15, ss_sold_date_sk#16]
Condition : isnotnull(ss_customer_sk#15)

(25) ReusedExchange [Reuses operator id: 60]
Output [1]: [d_date_sk#17]

(26) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [ss_sold_date_sk#16]
Right keys [1]: [d_date_sk#17]
Join type: Inner
Join condition: None

(27) Project [codegen id : 10]
Output [1]: [ss_customer_sk#15 AS customer_sk#18]
Input [3]: [ss_customer_sk#15, ss_sold_date_sk#16, d_date_sk#17]

(28) Exchange
Input [1]: [customer_sk#18]
Arguments: hashpartitioning(customer_sk#18, 5), ENSURE_REQUIREMENTS, [plan_id=3]

(29) Sort [codegen id : 11]
Input [1]: [customer_sk#18]
Arguments: [customer_sk#18 ASC NULLS FIRST], false, 0

(30) SortMergeJoin [codegen id : 13]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [customer_sk#18]
Join type: LeftSemi
Join condition: None

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

(32) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#19, ca_county#20]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_county, [Dona Ana County,Douglas County,Gaines County,Richland County,Walker County]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_county:string>

(33) ColumnarToRow [codegen id : 12]
Input [2]: [ca_address_sk#19, ca_county#20]

(34) Filter [codegen id : 12]
Input [2]: [ca_address_sk#19, ca_county#20]
Condition : (ca_county#20 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#19))

(35) Project [codegen id : 12]
Output [1]: [ca_address_sk#19]
Input [2]: [ca_address_sk#19, ca_county#20]

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

(37) BroadcastHashJoin [codegen id : 13]
Left keys [1]: [c_current_addr_sk#3]
Right keys [1]: [ca_address_sk#19]
Join type: Inner
Join condition: None

(38) Project [codegen id : 13]
Output [1]: [c_current_cdemo_sk#2]
Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#19]

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

(40) Scan parquet spark_catalog.default.customer_demographics
Output [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29]
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>

(41) ColumnarToRow
Input [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29]

(42) Filter
Input [9]: [cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29]
Condition : isnotnull(cd_demo_sk#21)

(43) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [c_current_cdemo_sk#2]
Right keys [1]: [cd_demo_sk#21]
Join type: Inner
Join condition: None

(44) Project [codegen id : 14]
Output [8]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29]
Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#21, cd_gender#22, cd_marital_status#23, cd_education_status#24, cd_purchase_estimate#25, cd_credit_rating#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29]

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

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

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

(48) TakeOrderedAndProject
Input [14]: [cd_gender#22, cd_marital_status#23, cd_education_status#24, cnt1#33, cd_purchase_estimate#25, cnt2#34, cd_credit_rating#26, cnt3#35, cd_dep_count#27, cnt4#36, cd_dep_employed_count#28, cnt5#37, cd_dep_college_count#29, cnt6#38]
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#25 ASC NULLS FIRST, cd_credit_rating#26 ASC NULLS FIRST, cd_dep_count#27 ASC NULLS FIRST, cd_dep_employed_count#28 ASC NULLS FIRST, cd_dep_college_count#29 ASC NULLS FIRST], [cd_gender#22, cd_marital_status#23, cd_education_status#24, cnt1#33, cd_purchase_estimate#25, cnt2#34, cd_credit_rating#26, cnt3#35, cd_dep_count#27, cnt4#36, cd_dep_employed_count#28, cnt5#37, cd_dep_college_count#29, cnt6#38]

===== Subqueries =====

Subquery:1 Hosting operator id = 3 Hosting Expression = Subquery scalar-subquery#4, [id=#5]
ObjectHashAggregate (55)
+- Exchange (54)
   +- ObjectHashAggregate (53)
      +- * Project (52)
         +- * Filter (51)
            +- * ColumnarToRow (50)
               +- Scan parquet spark_catalog.default.customer_address (49)


(49) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#19, ca_county#20]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_county, [Dona Ana County,Douglas County,Gaines County,Richland County,Walker County]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_county:string>

(50) ColumnarToRow [codegen id : 1]
Input [2]: [ca_address_sk#19, ca_county#20]

(51) Filter [codegen id : 1]
Input [2]: [ca_address_sk#19, ca_county#20]
Condition : (ca_county#20 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#19))

(52) Project [codegen id : 1]
Output [1]: [ca_address_sk#19]
Input [2]: [ca_address_sk#19, ca_county#20]

(53) ObjectHashAggregate
Input [1]: [ca_address_sk#19]
Keys: []
Functions [1]: [partial_bloom_filter_agg(xxhash64(ca_address_sk#19, 42), 2555, 57765, 0, 0)]
Aggregate Attributes [1]: [buf#39]
Results [1]: [buf#40]

(54) Exchange
Input [1]: [buf#40]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=7]

(55) ObjectHashAggregate
Input [1]: [buf#40]
Keys: []
Functions [1]: [bloom_filter_agg(xxhash64(ca_address_sk#19, 42), 2555, 57765, 0, 0)]
Aggregate Attributes [1]: [bloom_filter_agg(xxhash64(ca_address_sk#19, 42), 2555, 57765, 0, 0)#41]
Results [1]: [bloom_filter_agg(xxhash64(ca_address_sk#19, 42), 2555, 57765, 0, 0)#41 AS bloomFilter#42]

Subquery:2 Hosting operator id = 6 Hosting Expression = ws_sold_date_sk#7 IN dynamicpruning#8
BroadcastExchange (60)
+- * Project (59)
   +- * Filter (58)
      +- * ColumnarToRow (57)
         +- Scan parquet spark_catalog.default.date_dim (56)


(56) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#9, d_year#43, d_moy#44]
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,4), LessThanOrEqual(d_moy,7), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(57) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#9, d_year#43, d_moy#44]

(58) Filter [codegen id : 1]
Input [3]: [d_date_sk#9, d_year#43, d_moy#44]
Condition : (((((isnotnull(d_year#43) AND isnotnull(d_moy#44)) AND (d_year#43 = 2002)) AND (d_moy#44 >= 4)) AND (d_moy#44 <= 7)) AND isnotnull(d_date_sk#9))

(59) Project [codegen id : 1]
Output [1]: [d_date_sk#9]
Input [3]: [d_date_sk#9, d_year#43, d_moy#44]

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

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

Subquery:4 Hosting operator id = 22 Hosting Expression = ss_sold_date_sk#16 IN dynamicpruning#8


