== Physical Plan ==
TakeOrderedAndProject (47)
+- * HashAggregate (46)
   +- Exchange (45)
      +- * HashAggregate (44)
         +- * Project (43)
            +- * BroadcastHashJoin Inner BuildLeft (42)
               :- BroadcastExchange (38)
               :  +- * Project (37)
               :     +- * BroadcastHashJoin Inner BuildRight (36)
               :        :- * Project (30)
               :        :  +- * SortMergeJoin LeftAnti (29)
               :        :     :- * SortMergeJoin LeftAnti (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 (35)
               :           +- * Project (34)
               :              +- * Filter (33)
               :                 +- * ColumnarToRow (32)
               :                    +- Scan parquet spark_catalog.default.customer_address (31)
               +- * Filter (41)
                  +- * ColumnarToRow (40)
                     +- Scan parquet spark_catalog.default.customer_demographics (39)


(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_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_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2)) AND might_contain(Subquery scalar-subquery#4, [id=#1], 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=2]

(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.store_sales
Output [2]: [ss_customer_sk#5, ss_sold_date_sk#6]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)]
ReadSchema: struct<ss_customer_sk:int>

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

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

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

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

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

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

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

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

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

(16) ReusedExchange [Reuses operator id: 59]
Output [1]: [d_date_sk#11]

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

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

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

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

(21) SortMergeJoin [codegen id : 10]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [ws_bill_customer_sk#9]
Join type: LeftAnti
Join condition: None

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

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

(24) ReusedExchange [Reuses operator id: 59]
Output [1]: [d_date_sk#14]

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

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

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

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

(29) SortMergeJoin [codegen id : 15]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [cs_ship_customer_sk#12]
Join type: LeftAnti
Join condition: None

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

(31) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#15, ca_state#16]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_state, [GA,KY,NM]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string>

(32) ColumnarToRow [codegen id : 14]
Input [2]: [ca_address_sk#15, ca_state#16]

(33) Filter [codegen id : 14]
Input [2]: [ca_address_sk#15, ca_state#16]
Condition : (ca_state#16 IN (KY,GA,NM) AND isnotnull(ca_address_sk#15))

(34) Project [codegen id : 14]
Output [1]: [ca_address_sk#15]
Input [2]: [ca_address_sk#15, ca_state#16]

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

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

(37) Project [codegen id : 15]
Output [1]: [c_current_cdemo_sk#2]
Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#15]

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

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

(40) ColumnarToRow
Input [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22]

(41) Filter
Input [6]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22]
Condition : isnotnull(cd_demo_sk#17)

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

(43) Project [codegen id : 16]
Output [5]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22]
Input [7]: [c_current_cdemo_sk#2, cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22]

(44) HashAggregate [codegen id : 16]
Input [5]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22]
Keys [5]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#23]
Results [6]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, count#24]

(45) Exchange
Input [6]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, count#24]
Arguments: hashpartitioning(cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, 5), ENSURE_REQUIREMENTS, [plan_id=8]

(46) HashAggregate [codegen id : 17]
Input [6]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22, count#24]
Keys [5]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cd_purchase_estimate#21, cd_credit_rating#22]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#25]
Results [8]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, count(1)#25 AS cnt1#26, cd_purchase_estimate#21, count(1)#25 AS cnt2#27, cd_credit_rating#22, count(1)#25 AS cnt3#28]

(47) TakeOrderedAndProject
Input [8]: [cd_gender#18, cd_marital_status#19, cd_education_status#20, cnt1#26, cd_purchase_estimate#21, cnt2#27, cd_credit_rating#22, cnt3#28]
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_gender#18, cd_marital_status#19, cd_education_status#20, cnt1#26, cd_purchase_estimate#21, cnt2#27, cd_credit_rating#22, cnt3#28]

===== Subqueries =====

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


(48) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#15, ca_state#16]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [In(ca_state, [GA,KY,NM]), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string>

(49) ColumnarToRow [codegen id : 1]
Input [2]: [ca_address_sk#15, ca_state#16]

(50) Filter [codegen id : 1]
Input [2]: [ca_address_sk#15, ca_state#16]
Condition : (ca_state#16 IN (KY,GA,NM) AND isnotnull(ca_address_sk#15))

(51) Project [codegen id : 1]
Output [1]: [ca_address_sk#15]
Input [2]: [ca_address_sk#15, ca_state#16]

(52) ObjectHashAggregate
Input [1]: [ca_address_sk#15]
Keys: []
Functions [1]: [partial_bloom_filter_agg(xxhash64(ca_address_sk#15, 42), 55556, 899992, 0, 0)]
Aggregate Attributes [1]: [buf#29]
Results [1]: [buf#30]

(53) Exchange
Input [1]: [buf#30]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=9]

(54) ObjectHashAggregate
Input [1]: [buf#30]
Keys: []
Functions [1]: [bloom_filter_agg(xxhash64(ca_address_sk#15, 42), 55556, 899992, 0, 0)]
Aggregate Attributes [1]: [bloom_filter_agg(xxhash64(ca_address_sk#15, 42), 55556, 899992, 0, 0)#31]
Results [1]: [bloom_filter_agg(xxhash64(ca_address_sk#15, 42), 55556, 899992, 0, 0)#31 AS bloomFilter#32]

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


(55) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#8, d_year#33, d_moy#34]
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>

(56) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#8, d_year#33, d_moy#34]

(57) Filter [codegen id : 1]
Input [3]: [d_date_sk#8, d_year#33, d_moy#34]
Condition : (((((isnotnull(d_year#33) AND isnotnull(d_moy#34)) AND (d_year#33 = 2001)) AND (d_moy#34 >= 4)) AND (d_moy#34 <= 6)) AND isnotnull(d_date_sk#8))

(58) Project [codegen id : 1]
Output [1]: [d_date_sk#8]
Input [3]: [d_date_sk#8, d_year#33, d_moy#34]

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

Subquery:3 Hosting operator id = 14 Hosting Expression = ws_sold_date_sk#10 IN dynamicpruning#7

Subquery:4 Hosting operator id = 22 Hosting Expression = cs_sold_date_sk#13 IN dynamicpruning#7


