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


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

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

(3) Filter [codegen id : 2]
Input [2]: [ss_customer_sk#1, ss_sold_date_sk#2]
Condition : isnotnull(ss_customer_sk#1)

(4) ReusedExchange [Reuses operator id: 65]
Output [2]: [d_date_sk#4, d_date#5]

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

(6) Project [codegen id : 2]
Output [2]: [ss_customer_sk#1, d_date#5]
Input [4]: [ss_customer_sk#1, ss_sold_date_sk#2, d_date_sk#4, d_date#5]

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

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

(9) Scan parquet spark_catalog.default.customer
Output [3]: [c_customer_sk#6, c_first_name#7, c_last_name#8]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk)]
ReadSchema: struct<c_customer_sk:int,c_first_name:string,c_last_name:string>

(10) ColumnarToRow [codegen id : 4]
Input [3]: [c_customer_sk#6, c_first_name#7, c_last_name#8]

(11) Filter [codegen id : 4]
Input [3]: [c_customer_sk#6, c_first_name#7, c_last_name#8]
Condition : isnotnull(c_customer_sk#6)

(12) Exchange
Input [3]: [c_customer_sk#6, c_first_name#7, c_last_name#8]
Arguments: hashpartitioning(c_customer_sk#6, 5), ENSURE_REQUIREMENTS, [plan_id=2]

(13) Sort [codegen id : 5]
Input [3]: [c_customer_sk#6, c_first_name#7, c_last_name#8]
Arguments: [c_customer_sk#6 ASC NULLS FIRST], false, 0

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

(15) Project [codegen id : 6]
Output [3]: [c_last_name#8, c_first_name#7, d_date#5]
Input [5]: [ss_customer_sk#1, d_date#5, c_customer_sk#6, c_first_name#7, c_last_name#8]

(16) HashAggregate [codegen id : 6]
Input [3]: [c_last_name#8, c_first_name#7, d_date#5]
Keys [3]: [c_last_name#8, c_first_name#7, d_date#5]
Functions: []
Aggregate Attributes: []
Results [3]: [c_last_name#8, c_first_name#7, d_date#5]

(17) Exchange
Input [3]: [c_last_name#8, c_first_name#7, d_date#5]
Arguments: hashpartitioning(c_last_name#8, c_first_name#7, d_date#5, 5), ENSURE_REQUIREMENTS, [plan_id=3]

(18) HashAggregate [codegen id : 7]
Input [3]: [c_last_name#8, c_first_name#7, d_date#5]
Keys [3]: [c_last_name#8, c_first_name#7, d_date#5]
Functions: []
Aggregate Attributes: []
Results [3]: [c_last_name#8, c_first_name#7, d_date#5]

(19) Exchange
Input [3]: [c_last_name#8, c_first_name#7, d_date#5]
Arguments: hashpartitioning(coalesce(c_last_name#8, ), isnull(c_last_name#8), coalesce(c_first_name#7, ), isnull(c_first_name#7), coalesce(d_date#5, 1970-01-01), isnull(d_date#5), 5), ENSURE_REQUIREMENTS, [plan_id=4]

(20) Sort [codegen id : 8]
Input [3]: [c_last_name#8, c_first_name#7, d_date#5]
Arguments: [coalesce(c_last_name#8, ) ASC NULLS FIRST, isnull(c_last_name#8) ASC NULLS FIRST, coalesce(c_first_name#7, ) ASC NULLS FIRST, isnull(c_first_name#7) ASC NULLS FIRST, coalesce(d_date#5, 1970-01-01) ASC NULLS FIRST, isnull(d_date#5) ASC NULLS FIRST], false, 0

(21) Scan parquet spark_catalog.default.catalog_sales
Output [2]: [cs_bill_customer_sk#9, cs_sold_date_sk#10]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#10), dynamicpruningexpression(cs_sold_date_sk#10 IN dynamicpruning#3)]
PushedFilters: [IsNotNull(cs_bill_customer_sk)]
ReadSchema: struct<cs_bill_customer_sk:int>

(22) ColumnarToRow [codegen id : 10]
Input [2]: [cs_bill_customer_sk#9, cs_sold_date_sk#10]

(23) Filter [codegen id : 10]
Input [2]: [cs_bill_customer_sk#9, cs_sold_date_sk#10]
Condition : isnotnull(cs_bill_customer_sk#9)

(24) ReusedExchange [Reuses operator id: 65]
Output [2]: [d_date_sk#11, d_date#12]

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

(26) Project [codegen id : 10]
Output [2]: [cs_bill_customer_sk#9, d_date#12]
Input [4]: [cs_bill_customer_sk#9, cs_sold_date_sk#10, d_date_sk#11, d_date#12]

(27) Exchange
Input [2]: [cs_bill_customer_sk#9, d_date#12]
Arguments: hashpartitioning(cs_bill_customer_sk#9, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(28) Sort [codegen id : 11]
Input [2]: [cs_bill_customer_sk#9, d_date#12]
Arguments: [cs_bill_customer_sk#9 ASC NULLS FIRST], false, 0

(29) ReusedExchange [Reuses operator id: 12]
Output [3]: [c_customer_sk#13, c_first_name#14, c_last_name#15]

(30) Sort [codegen id : 13]
Input [3]: [c_customer_sk#13, c_first_name#14, c_last_name#15]
Arguments: [c_customer_sk#13 ASC NULLS FIRST], false, 0

(31) SortMergeJoin [codegen id : 14]
Left keys [1]: [cs_bill_customer_sk#9]
Right keys [1]: [c_customer_sk#13]
Join type: Inner
Join condition: None

(32) Project [codegen id : 14]
Output [3]: [c_last_name#15, c_first_name#14, d_date#12]
Input [5]: [cs_bill_customer_sk#9, d_date#12, c_customer_sk#13, c_first_name#14, c_last_name#15]

(33) HashAggregate [codegen id : 14]
Input [3]: [c_last_name#15, c_first_name#14, d_date#12]
Keys [3]: [c_last_name#15, c_first_name#14, d_date#12]
Functions: []
Aggregate Attributes: []
Results [3]: [c_last_name#15, c_first_name#14, d_date#12]

(34) Exchange
Input [3]: [c_last_name#15, c_first_name#14, d_date#12]
Arguments: hashpartitioning(c_last_name#15, c_first_name#14, d_date#12, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(35) HashAggregate [codegen id : 15]
Input [3]: [c_last_name#15, c_first_name#14, d_date#12]
Keys [3]: [c_last_name#15, c_first_name#14, d_date#12]
Functions: []
Aggregate Attributes: []
Results [3]: [c_last_name#15, c_first_name#14, d_date#12]

(36) Exchange
Input [3]: [c_last_name#15, c_first_name#14, d_date#12]
Arguments: hashpartitioning(coalesce(c_last_name#15, ), isnull(c_last_name#15), coalesce(c_first_name#14, ), isnull(c_first_name#14), coalesce(d_date#12, 1970-01-01), isnull(d_date#12), 5), ENSURE_REQUIREMENTS, [plan_id=7]

(37) Sort [codegen id : 16]
Input [3]: [c_last_name#15, c_first_name#14, d_date#12]
Arguments: [coalesce(c_last_name#15, ) ASC NULLS FIRST, isnull(c_last_name#15) ASC NULLS FIRST, coalesce(c_first_name#14, ) ASC NULLS FIRST, isnull(c_first_name#14) ASC NULLS FIRST, coalesce(d_date#12, 1970-01-01) ASC NULLS FIRST, isnull(d_date#12) ASC NULLS FIRST], false, 0

(38) SortMergeJoin [codegen id : 17]
Left keys [6]: [coalesce(c_last_name#8, ), isnull(c_last_name#8), coalesce(c_first_name#7, ), isnull(c_first_name#7), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)]
Right keys [6]: [coalesce(c_last_name#15, ), isnull(c_last_name#15), coalesce(c_first_name#14, ), isnull(c_first_name#14), coalesce(d_date#12, 1970-01-01), isnull(d_date#12)]
Join type: LeftSemi
Join condition: None

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

(40) ColumnarToRow [codegen id : 19]
Input [2]: [ws_bill_customer_sk#16, ws_sold_date_sk#17]

(41) Filter [codegen id : 19]
Input [2]: [ws_bill_customer_sk#16, ws_sold_date_sk#17]
Condition : isnotnull(ws_bill_customer_sk#16)

(42) ReusedExchange [Reuses operator id: 65]
Output [2]: [d_date_sk#18, d_date#19]

(43) BroadcastHashJoin [codegen id : 19]
Left keys [1]: [ws_sold_date_sk#17]
Right keys [1]: [d_date_sk#18]
Join type: Inner
Join condition: None

(44) Project [codegen id : 19]
Output [2]: [ws_bill_customer_sk#16, d_date#19]
Input [4]: [ws_bill_customer_sk#16, ws_sold_date_sk#17, d_date_sk#18, d_date#19]

(45) Exchange
Input [2]: [ws_bill_customer_sk#16, d_date#19]
Arguments: hashpartitioning(ws_bill_customer_sk#16, 5), ENSURE_REQUIREMENTS, [plan_id=8]

(46) Sort [codegen id : 20]
Input [2]: [ws_bill_customer_sk#16, d_date#19]
Arguments: [ws_bill_customer_sk#16 ASC NULLS FIRST], false, 0

(47) ReusedExchange [Reuses operator id: 12]
Output [3]: [c_customer_sk#20, c_first_name#21, c_last_name#22]

(48) Sort [codegen id : 22]
Input [3]: [c_customer_sk#20, c_first_name#21, c_last_name#22]
Arguments: [c_customer_sk#20 ASC NULLS FIRST], false, 0

(49) SortMergeJoin [codegen id : 23]
Left keys [1]: [ws_bill_customer_sk#16]
Right keys [1]: [c_customer_sk#20]
Join type: Inner
Join condition: None

(50) Project [codegen id : 23]
Output [3]: [c_last_name#22, c_first_name#21, d_date#19]
Input [5]: [ws_bill_customer_sk#16, d_date#19, c_customer_sk#20, c_first_name#21, c_last_name#22]

(51) HashAggregate [codegen id : 23]
Input [3]: [c_last_name#22, c_first_name#21, d_date#19]
Keys [3]: [c_last_name#22, c_first_name#21, d_date#19]
Functions: []
Aggregate Attributes: []
Results [3]: [c_last_name#22, c_first_name#21, d_date#19]

(52) Exchange
Input [3]: [c_last_name#22, c_first_name#21, d_date#19]
Arguments: hashpartitioning(c_last_name#22, c_first_name#21, d_date#19, 5), ENSURE_REQUIREMENTS, [plan_id=9]

(53) HashAggregate [codegen id : 24]
Input [3]: [c_last_name#22, c_first_name#21, d_date#19]
Keys [3]: [c_last_name#22, c_first_name#21, d_date#19]
Functions: []
Aggregate Attributes: []
Results [3]: [c_last_name#22, c_first_name#21, d_date#19]

(54) Exchange
Input [3]: [c_last_name#22, c_first_name#21, d_date#19]
Arguments: hashpartitioning(coalesce(c_last_name#22, ), isnull(c_last_name#22), coalesce(c_first_name#21, ), isnull(c_first_name#21), coalesce(d_date#19, 1970-01-01), isnull(d_date#19), 5), ENSURE_REQUIREMENTS, [plan_id=10]

(55) Sort [codegen id : 25]
Input [3]: [c_last_name#22, c_first_name#21, d_date#19]
Arguments: [coalesce(c_last_name#22, ) ASC NULLS FIRST, isnull(c_last_name#22) ASC NULLS FIRST, coalesce(c_first_name#21, ) ASC NULLS FIRST, isnull(c_first_name#21) ASC NULLS FIRST, coalesce(d_date#19, 1970-01-01) ASC NULLS FIRST, isnull(d_date#19) ASC NULLS FIRST], false, 0

(56) SortMergeJoin [codegen id : 26]
Left keys [6]: [coalesce(c_last_name#8, ), isnull(c_last_name#8), coalesce(c_first_name#7, ), isnull(c_first_name#7), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)]
Right keys [6]: [coalesce(c_last_name#22, ), isnull(c_last_name#22), coalesce(c_first_name#21, ), isnull(c_first_name#21), coalesce(d_date#19, 1970-01-01), isnull(d_date#19)]
Join type: LeftSemi
Join condition: None

(57) Project [codegen id : 26]
Output: []
Input [3]: [c_last_name#8, c_first_name#7, d_date#5]

(58) HashAggregate [codegen id : 26]
Input: []
Keys: []
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#23]
Results [1]: [count#24]

(59) Exchange
Input [1]: [count#24]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=11]

(60) HashAggregate [codegen id : 27]
Input [1]: [count#24]
Keys: []
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#25]
Results [1]: [count(1)#25 AS count(1)#26]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#2 IN dynamicpruning#3
BroadcastExchange (65)
+- * Project (64)
   +- * Filter (63)
      +- * ColumnarToRow (62)
         +- Scan parquet spark_catalog.default.date_dim (61)


(61) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#4, d_date#5, d_month_seq#27]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date,d_month_seq:int>

(62) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#4, d_date#5, d_month_seq#27]

(63) Filter [codegen id : 1]
Input [3]: [d_date_sk#4, d_date#5, d_month_seq#27]
Condition : (((isnotnull(d_month_seq#27) AND (d_month_seq#27 >= 1200)) AND (d_month_seq#27 <= 1211)) AND isnotnull(d_date_sk#4))

(64) Project [codegen id : 1]
Output [2]: [d_date_sk#4, d_date#5]
Input [3]: [d_date_sk#4, d_date#5, d_month_seq#27]

(65) BroadcastExchange
Input [2]: [d_date_sk#4, d_date#5]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=12]

Subquery:2 Hosting operator id = 21 Hosting Expression = cs_sold_date_sk#10 IN dynamicpruning#3

Subquery:3 Hosting operator id = 39 Hosting Expression = ws_sold_date_sk#17 IN dynamicpruning#3


