== 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 default.store_sales (1)
            :  :                    :           +- ReusedExchange (4)
            :  :                    +- * Sort (13)
            :  :                       +- Exchange (12)
            :  :                          +- * Filter (11)
            :  :                             +- * ColumnarToRow (10)
            :  :                                +- Scan parquet 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 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 default.web_sales (39)
                                 :           +- ReusedExchange (42)
                                 +- * Sort (48)
                                    +- ReusedExchange (47)


(1) Scan parquet 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 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, [id=#6]

(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 default.customer
Output [3]: [c_customer_sk#7, c_first_name#8, c_last_name#9]
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#7, c_first_name#8, c_last_name#9]

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

(12) Exchange
Input [3]: [c_customer_sk#7, c_first_name#8, c_last_name#9]
Arguments: hashpartitioning(c_customer_sk#7, 5), ENSURE_REQUIREMENTS, [id=#10]

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

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

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

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

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

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

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

(20) Sort [codegen id : 8]
Input [3]: [c_last_name#9, c_first_name#8, d_date#5]
Arguments: [coalesce(c_last_name#9, ) ASC NULLS FIRST, isnull(c_last_name#9) ASC NULLS FIRST, coalesce(c_first_name#8, ) ASC NULLS FIRST, isnull(c_first_name#8) 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 default.catalog_sales
Output [2]: [cs_bill_customer_sk#13, cs_sold_date_sk#14]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#14), dynamicpruningexpression(cs_sold_date_sk#14 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#13, cs_sold_date_sk#14]

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

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

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

(26) Project [codegen id : 10]
Output [2]: [cs_bill_customer_sk#13, d_date#16]
Input [4]: [cs_bill_customer_sk#13, cs_sold_date_sk#14, d_date_sk#15, d_date#16]

(27) Exchange
Input [2]: [cs_bill_customer_sk#13, d_date#16]
Arguments: hashpartitioning(cs_bill_customer_sk#13, 5), ENSURE_REQUIREMENTS, [id=#17]

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

(29) ReusedExchange [Reuses operator id: 12]
Output [3]: [c_customer_sk#18, c_first_name#19, c_last_name#20]

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

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

(32) Project [codegen id : 14]
Output [3]: [c_last_name#20, c_first_name#19, d_date#16]
Input [5]: [cs_bill_customer_sk#13, d_date#16, c_customer_sk#18, c_first_name#19, c_last_name#20]

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

(34) Exchange
Input [3]: [c_last_name#20, c_first_name#19, d_date#16]
Arguments: hashpartitioning(c_last_name#20, c_first_name#19, d_date#16, 5), ENSURE_REQUIREMENTS, [id=#21]

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

(36) Exchange
Input [3]: [c_last_name#20, c_first_name#19, d_date#16]
Arguments: hashpartitioning(coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#16, 1970-01-01), isnull(d_date#16), 5), ENSURE_REQUIREMENTS, [id=#22]

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

(38) SortMergeJoin [codegen id : 17]
Left keys [6]: [coalesce(c_last_name#9, ), isnull(c_last_name#9), coalesce(c_first_name#8, ), isnull(c_first_name#8), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)]
Right keys [6]: [coalesce(c_last_name#20, ), isnull(c_last_name#20), coalesce(c_first_name#19, ), isnull(c_first_name#19), coalesce(d_date#16, 1970-01-01), isnull(d_date#16)]
Join condition: None

(39) Scan parquet default.web_sales
Output [2]: [ws_bill_customer_sk#23, ws_sold_date_sk#24]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#24), dynamicpruningexpression(ws_sold_date_sk#24 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#23, ws_sold_date_sk#24]

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

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

(43) BroadcastHashJoin [codegen id : 19]
Left keys [1]: [ws_sold_date_sk#24]
Right keys [1]: [d_date_sk#25]
Join condition: None

(44) Project [codegen id : 19]
Output [2]: [ws_bill_customer_sk#23, d_date#26]
Input [4]: [ws_bill_customer_sk#23, ws_sold_date_sk#24, d_date_sk#25, d_date#26]

(45) Exchange
Input [2]: [ws_bill_customer_sk#23, d_date#26]
Arguments: hashpartitioning(ws_bill_customer_sk#23, 5), ENSURE_REQUIREMENTS, [id=#27]

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

(47) ReusedExchange [Reuses operator id: 12]
Output [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30]

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

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

(50) Project [codegen id : 23]
Output [3]: [c_last_name#30, c_first_name#29, d_date#26]
Input [5]: [ws_bill_customer_sk#23, d_date#26, c_customer_sk#28, c_first_name#29, c_last_name#30]

(51) HashAggregate [codegen id : 23]
Input [3]: [c_last_name#30, c_first_name#29, d_date#26]
Keys [3]: [c_last_name#30, c_first_name#29, d_date#26]
Functions: []
Aggregate Attributes: []
Results [3]: [c_last_name#30, c_first_name#29, d_date#26]

(52) Exchange
Input [3]: [c_last_name#30, c_first_name#29, d_date#26]
Arguments: hashpartitioning(c_last_name#30, c_first_name#29, d_date#26, 5), ENSURE_REQUIREMENTS, [id=#31]

(53) HashAggregate [codegen id : 24]
Input [3]: [c_last_name#30, c_first_name#29, d_date#26]
Keys [3]: [c_last_name#30, c_first_name#29, d_date#26]
Functions: []
Aggregate Attributes: []
Results [3]: [c_last_name#30, c_first_name#29, d_date#26]

(54) Exchange
Input [3]: [c_last_name#30, c_first_name#29, d_date#26]
Arguments: hashpartitioning(coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#26, 1970-01-01), isnull(d_date#26), 5), ENSURE_REQUIREMENTS, [id=#32]

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

(56) SortMergeJoin [codegen id : 26]
Left keys [6]: [coalesce(c_last_name#9, ), isnull(c_last_name#9), coalesce(c_first_name#8, ), isnull(c_first_name#8), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)]
Right keys [6]: [coalesce(c_last_name#30, ), isnull(c_last_name#30), coalesce(c_first_name#29, ), isnull(c_first_name#29), coalesce(d_date#26, 1970-01-01), isnull(d_date#26)]
Join condition: None

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

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

(59) Exchange
Input [1]: [count#34]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#35]

(60) HashAggregate [codegen id : 27]
Input [1]: [count#34]
Keys: []
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#36]
Results [1]: [count(1)#36 AS count(1)#37]

===== 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 default.date_dim (61)


(61) Scan parquet default.date_dim
Output [3]: [d_date_sk#4, d_date#5, d_month_seq#38]
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#38]

(63) Filter [codegen id : 1]
Input [3]: [d_date_sk#4, d_date#5, d_month_seq#38]
Condition : (((isnotnull(d_month_seq#38) AND (d_month_seq#38 >= 1200)) AND (d_month_seq#38 <= 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#38]

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

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

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


