== Physical Plan ==
* HashAggregate (84)
+- Exchange (83)
   +- * HashAggregate (82)
      +- Union (81)
         :- * Project (48)
         :  +- * BroadcastHashJoin Inner BuildRight (47)
         :     :- * Project (45)
         :     :  +- * SortMergeJoin LeftSemi (44)
         :     :     :- * Sort (27)
         :     :     :  +- Exchange (26)
         :     :     :     +- * Project (25)
         :     :     :        +- * SortMergeJoin LeftSemi (24)
         :     :     :           :- * Sort (4)
         :     :     :           :  +- Exchange (3)
         :     :     :           :     +- * ColumnarToRow (2)
         :     :     :           :        +- Scan parquet spark_catalog.default.catalog_sales (1)
         :     :     :           +- * Sort (23)
         :     :     :              +- * Project (22)
         :     :     :                 +- * Filter (21)
         :     :     :                    +- * HashAggregate (20)
         :     :     :                       +- * Project (19)
         :     :     :                          +- * SortMergeJoin Inner (18)
         :     :     :                             :- * Sort (12)
         :     :     :                             :  +- Exchange (11)
         :     :     :                             :     +- * Project (10)
         :     :     :                             :        +- * BroadcastHashJoin Inner BuildRight (9)
         :     :     :                             :           :- * Filter (7)
         :     :     :                             :           :  +- * ColumnarToRow (6)
         :     :     :                             :           :     +- Scan parquet spark_catalog.default.store_sales (5)
         :     :     :                             :           +- ReusedExchange (8)
         :     :     :                             +- * Sort (17)
         :     :     :                                +- Exchange (16)
         :     :     :                                   +- * Filter (15)
         :     :     :                                      +- * ColumnarToRow (14)
         :     :     :                                         +- Scan parquet spark_catalog.default.item (13)
         :     :     +- * Project (43)
         :     :        +- * Filter (42)
         :     :           +- * SortAggregate (41)
         :     :              +- * Project (40)
         :     :                 +- * SortMergeJoin Inner (39)
         :     :                    :- * Sort (33)
         :     :                    :  +- Exchange (32)
         :     :                    :     +- * Project (31)
         :     :                    :        +- * Filter (30)
         :     :                    :           +- * ColumnarToRow (29)
         :     :                    :              +- Scan parquet spark_catalog.default.store_sales (28)
         :     :                    +- * Sort (38)
         :     :                       +- Exchange (37)
         :     :                          +- * Filter (36)
         :     :                             +- * ColumnarToRow (35)
         :     :                                +- Scan parquet spark_catalog.default.customer (34)
         :     +- ReusedExchange (46)
         +- * Project (80)
            +- * BroadcastHashJoin Inner BuildRight (79)
               :- * Project (77)
               :  +- * SortMergeJoin LeftSemi (76)
               :     :- * Sort (66)
               :     :  +- Exchange (65)
               :     :     +- * Project (64)
               :     :        +- * SortMergeJoin LeftSemi (63)
               :     :           :- * Sort (52)
               :     :           :  +- Exchange (51)
               :     :           :     +- * ColumnarToRow (50)
               :     :           :        +- Scan parquet spark_catalog.default.web_sales (49)
               :     :           +- * Sort (62)
               :     :              +- * Project (61)
               :     :                 +- * Filter (60)
               :     :                    +- * HashAggregate (59)
               :     :                       +- * Project (58)
               :     :                          +- * SortMergeJoin Inner (57)
               :     :                             :- * Sort (54)
               :     :                             :  +- ReusedExchange (53)
               :     :                             +- * Sort (56)
               :     :                                +- ReusedExchange (55)
               :     +- * Project (75)
               :        +- * Filter (74)
               :           +- * SortAggregate (73)
               :              +- * Project (72)
               :                 +- * SortMergeJoin Inner (71)
               :                    :- * Sort (68)
               :                    :  +- ReusedExchange (67)
               :                    +- * Sort (70)
               :                       +- ReusedExchange (69)
               +- ReusedExchange (78)


(1) Scan parquet spark_catalog.default.catalog_sales
Output [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)]
ReadSchema: struct<cs_bill_customer_sk:int,cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2)>

(2) ColumnarToRow [codegen id : 1]
Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]

(3) Exchange
Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
Arguments: hashpartitioning(cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [plan_id=1]

(4) Sort [codegen id : 2]
Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0

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

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

(7) Filter [codegen id : 4]
Input [2]: [ss_item_sk#7, ss_sold_date_sk#8]
Condition : isnotnull(ss_item_sk#7)

(8) ReusedExchange [Reuses operator id: 94]
Output [2]: [d_date_sk#10, d_date#11]

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

(10) Project [codegen id : 4]
Output [2]: [ss_item_sk#7, d_date#11]
Input [4]: [ss_item_sk#7, ss_sold_date_sk#8, d_date_sk#10, d_date#11]

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

(12) Sort [codegen id : 5]
Input [2]: [ss_item_sk#7, d_date#11]
Arguments: [ss_item_sk#7 ASC NULLS FIRST], false, 0

(13) Scan parquet spark_catalog.default.item
Output [2]: [i_item_sk#12, i_item_desc#13]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_item_desc:string>

(14) ColumnarToRow [codegen id : 6]
Input [2]: [i_item_sk#12, i_item_desc#13]

(15) Filter [codegen id : 6]
Input [2]: [i_item_sk#12, i_item_desc#13]
Condition : isnotnull(i_item_sk#12)

(16) Exchange
Input [2]: [i_item_sk#12, i_item_desc#13]
Arguments: hashpartitioning(i_item_sk#12, 5), ENSURE_REQUIREMENTS, [plan_id=3]

(17) Sort [codegen id : 7]
Input [2]: [i_item_sk#12, i_item_desc#13]
Arguments: [i_item_sk#12 ASC NULLS FIRST], false, 0

(18) SortMergeJoin [codegen id : 8]
Left keys [1]: [ss_item_sk#7]
Right keys [1]: [i_item_sk#12]
Join type: Inner
Join condition: None

(19) Project [codegen id : 8]
Output [3]: [d_date#11, i_item_sk#12, substr(i_item_desc#13, 1, 30) AS _groupingexpression#14]
Input [4]: [ss_item_sk#7, d_date#11, i_item_sk#12, i_item_desc#13]

(20) HashAggregate [codegen id : 8]
Input [3]: [d_date#11, i_item_sk#12, _groupingexpression#14]
Keys [3]: [_groupingexpression#14, i_item_sk#12, d_date#11]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#15]
Results [2]: [i_item_sk#12 AS item_sk#16, count(1)#15 AS cnt#17]

(21) Filter [codegen id : 8]
Input [2]: [item_sk#16, cnt#17]
Condition : (cnt#17 > 4)

(22) Project [codegen id : 8]
Output [1]: [item_sk#16]
Input [2]: [item_sk#16, cnt#17]

(23) Sort [codegen id : 8]
Input [1]: [item_sk#16]
Arguments: [item_sk#16 ASC NULLS FIRST], false, 0

(24) SortMergeJoin [codegen id : 9]
Left keys [1]: [cs_item_sk#2]
Right keys [1]: [item_sk#16]
Join type: LeftSemi
Join condition: None

(25) Project [codegen id : 9]
Output [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]

(26) Exchange
Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=4]

(27) Sort [codegen id : 10]
Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0

(28) Scan parquet spark_catalog.default.store_sales
Output [4]: [ss_customer_sk#18, ss_quantity#19, ss_sales_price#20, ss_sold_date_sk#21]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_quantity:int,ss_sales_price:decimal(7,2)>

(29) ColumnarToRow [codegen id : 11]
Input [4]: [ss_customer_sk#18, ss_quantity#19, ss_sales_price#20, ss_sold_date_sk#21]

(30) Filter [codegen id : 11]
Input [4]: [ss_customer_sk#18, ss_quantity#19, ss_sales_price#20, ss_sold_date_sk#21]
Condition : isnotnull(ss_customer_sk#18)

(31) Project [codegen id : 11]
Output [3]: [ss_customer_sk#18, ss_quantity#19, ss_sales_price#20]
Input [4]: [ss_customer_sk#18, ss_quantity#19, ss_sales_price#20, ss_sold_date_sk#21]

(32) Exchange
Input [3]: [ss_customer_sk#18, ss_quantity#19, ss_sales_price#20]
Arguments: hashpartitioning(ss_customer_sk#18, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(33) Sort [codegen id : 12]
Input [3]: [ss_customer_sk#18, ss_quantity#19, ss_sales_price#20]
Arguments: [ss_customer_sk#18 ASC NULLS FIRST], false, 0

(34) Scan parquet spark_catalog.default.customer
Output [1]: [c_customer_sk#22]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk)]
ReadSchema: struct<c_customer_sk:int>

(35) ColumnarToRow [codegen id : 13]
Input [1]: [c_customer_sk#22]

(36) Filter [codegen id : 13]
Input [1]: [c_customer_sk#22]
Condition : isnotnull(c_customer_sk#22)

(37) Exchange
Input [1]: [c_customer_sk#22]
Arguments: hashpartitioning(c_customer_sk#22, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(38) Sort [codegen id : 14]
Input [1]: [c_customer_sk#22]
Arguments: [c_customer_sk#22 ASC NULLS FIRST], false, 0

(39) SortMergeJoin [codegen id : 15]
Left keys [1]: [ss_customer_sk#18]
Right keys [1]: [c_customer_sk#22]
Join type: Inner
Join condition: None

(40) Project [codegen id : 15]
Output [3]: [ss_quantity#19, ss_sales_price#20, c_customer_sk#22]
Input [4]: [ss_customer_sk#18, ss_quantity#19, ss_sales_price#20, c_customer_sk#22]

(41) SortAggregate [codegen id : 15]
Input [3]: [ss_quantity#19, ss_sales_price#20, c_customer_sk#22]
Keys [1]: [c_customer_sk#22]
Functions [1]: [sum((cast(ss_quantity#19 as decimal(10,0)) * ss_sales_price#20))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#19 as decimal(10,0)) * ss_sales_price#20))#23]
Results [2]: [c_customer_sk#22, sum((cast(ss_quantity#19 as decimal(10,0)) * ss_sales_price#20))#23 AS ssales#24]

(42) Filter [codegen id : 15]
Input [2]: [c_customer_sk#22, ssales#24]
Condition : (isnotnull(ssales#24) AND (cast(ssales#24 as decimal(38,8)) > (0.500000 * Subquery scalar-subquery#25, [id=#7])))

(43) Project [codegen id : 15]
Output [1]: [c_customer_sk#22]
Input [2]: [c_customer_sk#22, ssales#24]

(44) SortMergeJoin [codegen id : 17]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#22]
Join type: LeftSemi
Join condition: None

(45) Project [codegen id : 17]
Output [3]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]

(46) ReusedExchange [Reuses operator id: 89]
Output [1]: [d_date_sk#26]

(47) BroadcastHashJoin [codegen id : 17]
Left keys [1]: [cs_sold_date_sk#5]
Right keys [1]: [d_date_sk#26]
Join type: Inner
Join condition: None

(48) Project [codegen id : 17]
Output [1]: [(cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4) AS sales#27]
Input [4]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, d_date_sk#26]

(49) Scan parquet spark_catalog.default.web_sales
Output [5]: [ws_item_sk#28, ws_bill_customer_sk#29, ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#32), dynamicpruningexpression(ws_sold_date_sk#32 IN dynamicpruning#6)]
ReadSchema: struct<ws_item_sk:int,ws_bill_customer_sk:int,ws_quantity:int,ws_list_price:decimal(7,2)>

(50) ColumnarToRow [codegen id : 18]
Input [5]: [ws_item_sk#28, ws_bill_customer_sk#29, ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32]

(51) Exchange
Input [5]: [ws_item_sk#28, ws_bill_customer_sk#29, ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32]
Arguments: hashpartitioning(ws_item_sk#28, 5), ENSURE_REQUIREMENTS, [plan_id=8]

(52) Sort [codegen id : 19]
Input [5]: [ws_item_sk#28, ws_bill_customer_sk#29, ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32]
Arguments: [ws_item_sk#28 ASC NULLS FIRST], false, 0

(53) ReusedExchange [Reuses operator id: 11]
Output [2]: [ss_item_sk#33, d_date#34]

(54) Sort [codegen id : 22]
Input [2]: [ss_item_sk#33, d_date#34]
Arguments: [ss_item_sk#33 ASC NULLS FIRST], false, 0

(55) ReusedExchange [Reuses operator id: 16]
Output [2]: [i_item_sk#35, i_item_desc#36]

(56) Sort [codegen id : 24]
Input [2]: [i_item_sk#35, i_item_desc#36]
Arguments: [i_item_sk#35 ASC NULLS FIRST], false, 0

(57) SortMergeJoin [codegen id : 25]
Left keys [1]: [ss_item_sk#33]
Right keys [1]: [i_item_sk#35]
Join type: Inner
Join condition: None

(58) Project [codegen id : 25]
Output [3]: [d_date#34, i_item_sk#35, substr(i_item_desc#36, 1, 30) AS _groupingexpression#37]
Input [4]: [ss_item_sk#33, d_date#34, i_item_sk#35, i_item_desc#36]

(59) HashAggregate [codegen id : 25]
Input [3]: [d_date#34, i_item_sk#35, _groupingexpression#37]
Keys [3]: [_groupingexpression#37, i_item_sk#35, d_date#34]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#15]
Results [2]: [i_item_sk#35 AS item_sk#38, count(1)#15 AS cnt#39]

(60) Filter [codegen id : 25]
Input [2]: [item_sk#38, cnt#39]
Condition : (cnt#39 > 4)

(61) Project [codegen id : 25]
Output [1]: [item_sk#38]
Input [2]: [item_sk#38, cnt#39]

(62) Sort [codegen id : 25]
Input [1]: [item_sk#38]
Arguments: [item_sk#38 ASC NULLS FIRST], false, 0

(63) SortMergeJoin [codegen id : 26]
Left keys [1]: [ws_item_sk#28]
Right keys [1]: [item_sk#38]
Join type: LeftSemi
Join condition: None

(64) Project [codegen id : 26]
Output [4]: [ws_bill_customer_sk#29, ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32]
Input [5]: [ws_item_sk#28, ws_bill_customer_sk#29, ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32]

(65) Exchange
Input [4]: [ws_bill_customer_sk#29, ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32]
Arguments: hashpartitioning(ws_bill_customer_sk#29, 5), ENSURE_REQUIREMENTS, [plan_id=9]

(66) Sort [codegen id : 27]
Input [4]: [ws_bill_customer_sk#29, ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32]
Arguments: [ws_bill_customer_sk#29 ASC NULLS FIRST], false, 0

(67) ReusedExchange [Reuses operator id: 32]
Output [3]: [ss_customer_sk#40, ss_quantity#41, ss_sales_price#42]

(68) Sort [codegen id : 29]
Input [3]: [ss_customer_sk#40, ss_quantity#41, ss_sales_price#42]
Arguments: [ss_customer_sk#40 ASC NULLS FIRST], false, 0

(69) ReusedExchange [Reuses operator id: 37]
Output [1]: [c_customer_sk#43]

(70) Sort [codegen id : 31]
Input [1]: [c_customer_sk#43]
Arguments: [c_customer_sk#43 ASC NULLS FIRST], false, 0

(71) SortMergeJoin [codegen id : 32]
Left keys [1]: [ss_customer_sk#40]
Right keys [1]: [c_customer_sk#43]
Join type: Inner
Join condition: None

(72) Project [codegen id : 32]
Output [3]: [ss_quantity#41, ss_sales_price#42, c_customer_sk#43]
Input [4]: [ss_customer_sk#40, ss_quantity#41, ss_sales_price#42, c_customer_sk#43]

(73) SortAggregate [codegen id : 32]
Input [3]: [ss_quantity#41, ss_sales_price#42, c_customer_sk#43]
Keys [1]: [c_customer_sk#43]
Functions [1]: [sum((cast(ss_quantity#41 as decimal(10,0)) * ss_sales_price#42))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#41 as decimal(10,0)) * ss_sales_price#42))#23]
Results [2]: [c_customer_sk#43, sum((cast(ss_quantity#41 as decimal(10,0)) * ss_sales_price#42))#23 AS ssales#44]

(74) Filter [codegen id : 32]
Input [2]: [c_customer_sk#43, ssales#44]
Condition : (isnotnull(ssales#44) AND (cast(ssales#44 as decimal(38,8)) > (0.500000 * ReusedSubquery Subquery scalar-subquery#25, [id=#7])))

(75) Project [codegen id : 32]
Output [1]: [c_customer_sk#43]
Input [2]: [c_customer_sk#43, ssales#44]

(76) SortMergeJoin [codegen id : 34]
Left keys [1]: [ws_bill_customer_sk#29]
Right keys [1]: [c_customer_sk#43]
Join type: LeftSemi
Join condition: None

(77) Project [codegen id : 34]
Output [3]: [ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32]
Input [4]: [ws_bill_customer_sk#29, ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32]

(78) ReusedExchange [Reuses operator id: 89]
Output [1]: [d_date_sk#45]

(79) BroadcastHashJoin [codegen id : 34]
Left keys [1]: [ws_sold_date_sk#32]
Right keys [1]: [d_date_sk#45]
Join type: Inner
Join condition: None

(80) Project [codegen id : 34]
Output [1]: [(cast(ws_quantity#30 as decimal(10,0)) * ws_list_price#31) AS sales#46]
Input [4]: [ws_quantity#30, ws_list_price#31, ws_sold_date_sk#32, d_date_sk#45]

(81) Union

(82) HashAggregate [codegen id : 35]
Input [1]: [sales#27]
Keys: []
Functions [1]: [partial_sum(sales#27)]
Aggregate Attributes [2]: [sum#47, isEmpty#48]
Results [2]: [sum#49, isEmpty#50]

(83) Exchange
Input [2]: [sum#49, isEmpty#50]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=10]

(84) HashAggregate [codegen id : 36]
Input [2]: [sum#49, isEmpty#50]
Keys: []
Functions [1]: [sum(sales#27)]
Aggregate Attributes [1]: [sum(sales#27)#51]
Results [1]: [sum(sales#27)#51 AS sum(sales)#52]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6
BroadcastExchange (89)
+- * Project (88)
   +- * Filter (87)
      +- * ColumnarToRow (86)
         +- Scan parquet spark_catalog.default.date_dim (85)


(85) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#26, d_year#53, d_moy#54]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(86) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#26, d_year#53, d_moy#54]

(87) Filter [codegen id : 1]
Input [3]: [d_date_sk#26, d_year#53, d_moy#54]
Condition : ((((isnotnull(d_year#53) AND isnotnull(d_moy#54)) AND (d_year#53 = 2000)) AND (d_moy#54 = 2)) AND isnotnull(d_date_sk#26))

(88) Project [codegen id : 1]
Output [1]: [d_date_sk#26]
Input [3]: [d_date_sk#26, d_year#53, d_moy#54]

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

Subquery:2 Hosting operator id = 5 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9
BroadcastExchange (94)
+- * Project (93)
   +- * Filter (92)
      +- * ColumnarToRow (91)
         +- Scan parquet spark_catalog.default.date_dim (90)


(90) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#10, d_date#11, d_year#55]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date,d_year:int>

(91) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#10, d_date#11, d_year#55]

(92) Filter [codegen id : 1]
Input [3]: [d_date_sk#10, d_date#11, d_year#55]
Condition : (d_year#55 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#10))

(93) Project [codegen id : 1]
Output [2]: [d_date_sk#10, d_date#11]
Input [3]: [d_date_sk#10, d_date#11, d_year#55]

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

Subquery:3 Hosting operator id = 42 Hosting Expression = Subquery scalar-subquery#25, [id=#7]
* HashAggregate (110)
+- Exchange (109)
   +- * HashAggregate (108)
      +- * SortAggregate (107)
         +- * Project (106)
            +- * SortMergeJoin Inner (105)
               :- * Sort (102)
               :  +- Exchange (101)
               :     +- * Project (100)
               :        +- * BroadcastHashJoin Inner BuildRight (99)
               :           :- * Filter (97)
               :           :  +- * ColumnarToRow (96)
               :           :     +- Scan parquet spark_catalog.default.store_sales (95)
               :           +- ReusedExchange (98)
               +- * Sort (104)
                  +- ReusedExchange (103)


(95) Scan parquet spark_catalog.default.store_sales
Output [4]: [ss_customer_sk#56, ss_quantity#57, ss_sales_price#58, ss_sold_date_sk#59]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#59), dynamicpruningexpression(ss_sold_date_sk#59 IN dynamicpruning#60)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_quantity:int,ss_sales_price:decimal(7,2)>

(96) ColumnarToRow [codegen id : 2]
Input [4]: [ss_customer_sk#56, ss_quantity#57, ss_sales_price#58, ss_sold_date_sk#59]

(97) Filter [codegen id : 2]
Input [4]: [ss_customer_sk#56, ss_quantity#57, ss_sales_price#58, ss_sold_date_sk#59]
Condition : isnotnull(ss_customer_sk#56)

(98) ReusedExchange [Reuses operator id: 115]
Output [1]: [d_date_sk#61]

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

(100) Project [codegen id : 2]
Output [3]: [ss_customer_sk#56, ss_quantity#57, ss_sales_price#58]
Input [5]: [ss_customer_sk#56, ss_quantity#57, ss_sales_price#58, ss_sold_date_sk#59, d_date_sk#61]

(101) Exchange
Input [3]: [ss_customer_sk#56, ss_quantity#57, ss_sales_price#58]
Arguments: hashpartitioning(ss_customer_sk#56, 5), ENSURE_REQUIREMENTS, [plan_id=13]

(102) Sort [codegen id : 3]
Input [3]: [ss_customer_sk#56, ss_quantity#57, ss_sales_price#58]
Arguments: [ss_customer_sk#56 ASC NULLS FIRST], false, 0

(103) ReusedExchange [Reuses operator id: 37]
Output [1]: [c_customer_sk#62]

(104) Sort [codegen id : 5]
Input [1]: [c_customer_sk#62]
Arguments: [c_customer_sk#62 ASC NULLS FIRST], false, 0

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

(106) Project [codegen id : 6]
Output [3]: [ss_quantity#57, ss_sales_price#58, c_customer_sk#62]
Input [4]: [ss_customer_sk#56, ss_quantity#57, ss_sales_price#58, c_customer_sk#62]

(107) SortAggregate [codegen id : 6]
Input [3]: [ss_quantity#57, ss_sales_price#58, c_customer_sk#62]
Keys [1]: [c_customer_sk#62]
Functions [1]: [sum((cast(ss_quantity#57 as decimal(10,0)) * ss_sales_price#58))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#57 as decimal(10,0)) * ss_sales_price#58))#63]
Results [1]: [sum((cast(ss_quantity#57 as decimal(10,0)) * ss_sales_price#58))#63 AS csales#64]

(108) HashAggregate [codegen id : 6]
Input [1]: [csales#64]
Keys: []
Functions [1]: [partial_max(csales#64)]
Aggregate Attributes [1]: [max#65]
Results [1]: [max#66]

(109) Exchange
Input [1]: [max#66]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=14]

(110) HashAggregate [codegen id : 7]
Input [1]: [max#66]
Keys: []
Functions [1]: [max(csales#64)]
Aggregate Attributes [1]: [max(csales#64)#67]
Results [1]: [max(csales#64)#67 AS tpcds_cmax#68]

Subquery:4 Hosting operator id = 95 Hosting Expression = ss_sold_date_sk#59 IN dynamicpruning#60
BroadcastExchange (115)
+- * Project (114)
   +- * Filter (113)
      +- * ColumnarToRow (112)
         +- Scan parquet spark_catalog.default.date_dim (111)


(111) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#61, d_year#69]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(112) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#61, d_year#69]

(113) Filter [codegen id : 1]
Input [2]: [d_date_sk#61, d_year#69]
Condition : (d_year#69 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#61))

(114) Project [codegen id : 1]
Output [1]: [d_date_sk#61]
Input [2]: [d_date_sk#61, d_year#69]

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

Subquery:5 Hosting operator id = 49 Hosting Expression = ws_sold_date_sk#32 IN dynamicpruning#6

Subquery:6 Hosting operator id = 74 Hosting Expression = ReusedSubquery Subquery scalar-subquery#25, [id=#7]


