== Physical Plan ==
* HashAggregate (67)
+- Exchange (66)
   +- * HashAggregate (65)
      +- * HashAggregate (64)
         +- Exchange (63)
            +- * HashAggregate (62)
               +- * SortMergeJoin LeftSemi (61)
                  :- * Sort (43)
                  :  +- Exchange (42)
                  :     +- * HashAggregate (41)
                  :        +- Exchange (40)
                  :           +- * HashAggregate (39)
                  :              +- * 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 (60)
                     +- Exchange (59)
                        +- * HashAggregate (58)
                           +- Exchange (57)
                              +- * HashAggregate (56)
                                 +- * Project (55)
                                    +- * SortMergeJoin Inner (54)
                                       :- * Sort (51)
                                       :  +- Exchange (50)
                                       :     +- * Project (49)
                                       :        +- * BroadcastHashJoin Inner BuildRight (48)
                                       :           :- * Filter (46)
                                       :           :  +- * ColumnarToRow (45)
                                       :           :     +- Scan parquet default.web_sales (44)
                                       :           +- ReusedExchange (47)
                                       +- * Sort (53)
                                          +- ReusedExchange (52)


(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: 72]
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: 72]
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) HashAggregate [codegen id : 17]
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]

(40) 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=#23]

(41) HashAggregate [codegen id : 18]
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]

(42) 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=#24]

(43) Sort [codegen id : 19]
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

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

(45) ColumnarToRow [codegen id : 21]
Input [2]: [ws_bill_customer_sk#25, ws_sold_date_sk#26]

(46) Filter [codegen id : 21]
Input [2]: [ws_bill_customer_sk#25, ws_sold_date_sk#26]
Condition : isnotnull(ws_bill_customer_sk#25)

(47) ReusedExchange [Reuses operator id: 72]
Output [2]: [d_date_sk#27, d_date#28]

(48) BroadcastHashJoin [codegen id : 21]
Left keys [1]: [ws_sold_date_sk#26]
Right keys [1]: [d_date_sk#27]
Join condition: None

(49) Project [codegen id : 21]
Output [2]: [ws_bill_customer_sk#25, d_date#28]
Input [4]: [ws_bill_customer_sk#25, ws_sold_date_sk#26, d_date_sk#27, d_date#28]

(50) Exchange
Input [2]: [ws_bill_customer_sk#25, d_date#28]
Arguments: hashpartitioning(ws_bill_customer_sk#25, 5), ENSURE_REQUIREMENTS, [id=#29]

(51) Sort [codegen id : 22]
Input [2]: [ws_bill_customer_sk#25, d_date#28]
Arguments: [ws_bill_customer_sk#25 ASC NULLS FIRST], false, 0

(52) ReusedExchange [Reuses operator id: 12]
Output [3]: [c_customer_sk#30, c_first_name#31, c_last_name#32]

(53) Sort [codegen id : 24]
Input [3]: [c_customer_sk#30, c_first_name#31, c_last_name#32]
Arguments: [c_customer_sk#30 ASC NULLS FIRST], false, 0

(54) SortMergeJoin [codegen id : 25]
Left keys [1]: [ws_bill_customer_sk#25]
Right keys [1]: [c_customer_sk#30]
Join condition: None

(55) Project [codegen id : 25]
Output [3]: [c_last_name#32, c_first_name#31, d_date#28]
Input [5]: [ws_bill_customer_sk#25, d_date#28, c_customer_sk#30, c_first_name#31, c_last_name#32]

(56) HashAggregate [codegen id : 25]
Input [3]: [c_last_name#32, c_first_name#31, d_date#28]
Keys [3]: [c_last_name#32, c_first_name#31, d_date#28]
Functions: []
Aggregate Attributes: []
Results [3]: [c_last_name#32, c_first_name#31, d_date#28]

(57) Exchange
Input [3]: [c_last_name#32, c_first_name#31, d_date#28]
Arguments: hashpartitioning(c_last_name#32, c_first_name#31, d_date#28, 5), ENSURE_REQUIREMENTS, [id=#33]

(58) HashAggregate [codegen id : 26]
Input [3]: [c_last_name#32, c_first_name#31, d_date#28]
Keys [3]: [c_last_name#32, c_first_name#31, d_date#28]
Functions: []
Aggregate Attributes: []
Results [3]: [c_last_name#32, c_first_name#31, d_date#28]

(59) Exchange
Input [3]: [c_last_name#32, c_first_name#31, d_date#28]
Arguments: hashpartitioning(coalesce(c_last_name#32, ), isnull(c_last_name#32), coalesce(c_first_name#31, ), isnull(c_first_name#31), coalesce(d_date#28, 1970-01-01), isnull(d_date#28), 5), ENSURE_REQUIREMENTS, [id=#34]

(60) Sort [codegen id : 27]
Input [3]: [c_last_name#32, c_first_name#31, d_date#28]
Arguments: [coalesce(c_last_name#32, ) ASC NULLS FIRST, isnull(c_last_name#32) ASC NULLS FIRST, coalesce(c_first_name#31, ) ASC NULLS FIRST, isnull(c_first_name#31) ASC NULLS FIRST, coalesce(d_date#28, 1970-01-01) ASC NULLS FIRST, isnull(d_date#28) ASC NULLS FIRST], false, 0

(61) SortMergeJoin [codegen id : 28]
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#32, ), isnull(c_last_name#32), coalesce(c_first_name#31, ), isnull(c_first_name#31), coalesce(d_date#28, 1970-01-01), isnull(d_date#28)]
Join condition: None

(62) HashAggregate [codegen id : 28]
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]

(63) 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=#35]

(64) HashAggregate [codegen id : 29]
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: []

(65) HashAggregate [codegen id : 29]
Input: []
Keys: []
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#36]
Results [1]: [count#37]

(66) Exchange
Input [1]: [count#37]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#38]

(67) HashAggregate [codegen id : 30]
Input [1]: [count#37]
Keys: []
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#39]
Results [1]: [count(1)#39 AS count(1)#40]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#2 IN dynamicpruning#3
BroadcastExchange (72)
+- * Project (71)
   +- * Filter (70)
      +- * ColumnarToRow (69)
         +- Scan parquet default.date_dim (68)


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

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

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

(71) 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#41]

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

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

Subquery:3 Hosting operator id = 44 Hosting Expression = ws_sold_date_sk#26 IN dynamicpruning#3


