== Physical Plan ==
* HashAggregate (90)
+- Exchange (89)
   +- * HashAggregate (88)
      +- Union (87)
         :- * Project (51)
         :  +- * BroadcastHashJoin Inner BuildRight (50)
         :     :- * Project (48)
         :     :  +- * SortMergeJoin LeftSemi (47)
         :     :     :- * Sort (28)
         :     :     :  +- Exchange (27)
         :     :     :     +- * Project (26)
         :     :     :        +- * SortMergeJoin LeftSemi (25)
         :     :     :           :- * Sort (4)
         :     :     :           :  +- Exchange (3)
         :     :     :           :     +- * ColumnarToRow (2)
         :     :     :           :        +- Scan parquet spark_catalog.default.catalog_sales (1)
         :     :     :           +- * Sort (24)
         :     :     :              +- * Project (23)
         :     :     :                 +- * Filter (22)
         :     :     :                    +- * HashAggregate (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)
         :     :     +- * Sort (46)
         :     :        +- * Project (45)
         :     :           +- * Filter (44)
         :     :              +- * HashAggregate (43)
         :     :                 +- * HashAggregate (42)
         :     :                    +- * Project (41)
         :     :                       +- * SortMergeJoin Inner (40)
         :     :                          :- * Sort (34)
         :     :                          :  +- Exchange (33)
         :     :                          :     +- * Project (32)
         :     :                          :        +- * Filter (31)
         :     :                          :           +- * ColumnarToRow (30)
         :     :                          :              +- Scan parquet spark_catalog.default.store_sales (29)
         :     :                          +- * Sort (39)
         :     :                             +- Exchange (38)
         :     :                                +- * Filter (37)
         :     :                                   +- * ColumnarToRow (36)
         :     :                                      +- Scan parquet spark_catalog.default.customer (35)
         :     +- ReusedExchange (49)
         +- * Project (86)
            +- * BroadcastHashJoin Inner BuildRight (85)
               :- * Project (83)
               :  +- * SortMergeJoin LeftSemi (82)
               :     :- * Sort (70)
               :     :  +- Exchange (69)
               :     :     +- * Project (68)
               :     :        +- * SortMergeJoin LeftSemi (67)
               :     :           :- * Sort (55)
               :     :           :  +- Exchange (54)
               :     :           :     +- * ColumnarToRow (53)
               :     :           :        +- Scan parquet spark_catalog.default.web_sales (52)
               :     :           +- * Sort (66)
               :     :              +- * Project (65)
               :     :                 +- * Filter (64)
               :     :                    +- * HashAggregate (63)
               :     :                       +- * HashAggregate (62)
               :     :                          +- * Project (61)
               :     :                             +- * SortMergeJoin Inner (60)
               :     :                                :- * Sort (57)
               :     :                                :  +- ReusedExchange (56)
               :     :                                +- * Sort (59)
               :     :                                   +- ReusedExchange (58)
               :     +- * Sort (81)
               :        +- * Project (80)
               :           +- * Filter (79)
               :              +- * HashAggregate (78)
               :                 +- * HashAggregate (77)
               :                    +- * Project (76)
               :                       +- * SortMergeJoin Inner (75)
               :                          :- * Sort (72)
               :                          :  +- ReusedExchange (71)
               :                          +- * Sort (74)
               :                             +- ReusedExchange (73)
               +- ReusedExchange (84)


(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: 100]
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]: [partial_count(1)]
Aggregate Attributes [1]: [count#15]
Results [4]: [_groupingexpression#14, i_item_sk#12, d_date#11, count#16]

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

(22) Filter [codegen id : 8]
Input [2]: [item_sk#18, cnt#19]
Condition : (cnt#19 > 4)

(23) Project [codegen id : 8]
Output [1]: [item_sk#18]
Input [2]: [item_sk#18, cnt#19]

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

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

(26) 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]

(27) 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]

(28) 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

(29) Scan parquet spark_catalog.default.store_sales
Output [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, ss_sold_date_sk#23]
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)>

(30) ColumnarToRow [codegen id : 11]
Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, ss_sold_date_sk#23]

(31) Filter [codegen id : 11]
Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, ss_sold_date_sk#23]
Condition : isnotnull(ss_customer_sk#20)

(32) Project [codegen id : 11]
Output [3]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22]
Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, ss_sold_date_sk#23]

(33) Exchange
Input [3]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22]
Arguments: hashpartitioning(ss_customer_sk#20, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(34) Sort [codegen id : 12]
Input [3]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22]
Arguments: [ss_customer_sk#20 ASC NULLS FIRST], false, 0

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

(36) ColumnarToRow [codegen id : 13]
Input [1]: [c_customer_sk#24]

(37) Filter [codegen id : 13]
Input [1]: [c_customer_sk#24]
Condition : isnotnull(c_customer_sk#24)

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

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

(40) SortMergeJoin [codegen id : 15]
Left keys [1]: [ss_customer_sk#20]
Right keys [1]: [c_customer_sk#24]
Join type: Inner
Join condition: None

(41) Project [codegen id : 15]
Output [3]: [ss_quantity#21, ss_sales_price#22, c_customer_sk#24]
Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, c_customer_sk#24]

(42) HashAggregate [codegen id : 15]
Input [3]: [ss_quantity#21, ss_sales_price#22, c_customer_sk#24]
Keys [1]: [c_customer_sk#24]
Functions [1]: [partial_sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))]
Aggregate Attributes [2]: [sum#25, isEmpty#26]
Results [3]: [c_customer_sk#24, sum#27, isEmpty#28]

(43) HashAggregate [codegen id : 15]
Input [3]: [c_customer_sk#24, sum#27, isEmpty#28]
Keys [1]: [c_customer_sk#24]
Functions [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29]
Results [2]: [c_customer_sk#24, sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29 AS ssales#30]

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

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

(46) Sort [codegen id : 15]
Input [1]: [c_customer_sk#24]
Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0

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

(48) 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]

(49) ReusedExchange [Reuses operator id: 95]
Output [1]: [d_date_sk#32]

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

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

(52) Scan parquet spark_catalog.default.web_sales
Output [5]: [ws_item_sk#34, ws_bill_customer_sk#35, ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#38), dynamicpruningexpression(ws_sold_date_sk#38 IN dynamicpruning#6)]
ReadSchema: struct<ws_item_sk:int,ws_bill_customer_sk:int,ws_quantity:int,ws_list_price:decimal(7,2)>

(53) ColumnarToRow [codegen id : 18]
Input [5]: [ws_item_sk#34, ws_bill_customer_sk#35, ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38]

(54) Exchange
Input [5]: [ws_item_sk#34, ws_bill_customer_sk#35, ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38]
Arguments: hashpartitioning(ws_item_sk#34, 5), ENSURE_REQUIREMENTS, [plan_id=8]

(55) Sort [codegen id : 19]
Input [5]: [ws_item_sk#34, ws_bill_customer_sk#35, ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38]
Arguments: [ws_item_sk#34 ASC NULLS FIRST], false, 0

(56) ReusedExchange [Reuses operator id: 11]
Output [2]: [ss_item_sk#39, d_date#40]

(57) Sort [codegen id : 22]
Input [2]: [ss_item_sk#39, d_date#40]
Arguments: [ss_item_sk#39 ASC NULLS FIRST], false, 0

(58) ReusedExchange [Reuses operator id: 16]
Output [2]: [i_item_sk#41, i_item_desc#42]

(59) Sort [codegen id : 24]
Input [2]: [i_item_sk#41, i_item_desc#42]
Arguments: [i_item_sk#41 ASC NULLS FIRST], false, 0

(60) SortMergeJoin [codegen id : 25]
Left keys [1]: [ss_item_sk#39]
Right keys [1]: [i_item_sk#41]
Join type: Inner
Join condition: None

(61) Project [codegen id : 25]
Output [3]: [d_date#40, i_item_sk#41, substr(i_item_desc#42, 1, 30) AS _groupingexpression#43]
Input [4]: [ss_item_sk#39, d_date#40, i_item_sk#41, i_item_desc#42]

(62) HashAggregate [codegen id : 25]
Input [3]: [d_date#40, i_item_sk#41, _groupingexpression#43]
Keys [3]: [_groupingexpression#43, i_item_sk#41, d_date#40]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#15]
Results [4]: [_groupingexpression#43, i_item_sk#41, d_date#40, count#16]

(63) HashAggregate [codegen id : 25]
Input [4]: [_groupingexpression#43, i_item_sk#41, d_date#40, count#16]
Keys [3]: [_groupingexpression#43, i_item_sk#41, d_date#40]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#17]
Results [2]: [i_item_sk#41 AS item_sk#44, count(1)#17 AS cnt#45]

(64) Filter [codegen id : 25]
Input [2]: [item_sk#44, cnt#45]
Condition : (cnt#45 > 4)

(65) Project [codegen id : 25]
Output [1]: [item_sk#44]
Input [2]: [item_sk#44, cnt#45]

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

(67) SortMergeJoin [codegen id : 26]
Left keys [1]: [ws_item_sk#34]
Right keys [1]: [item_sk#44]
Join type: LeftSemi
Join condition: None

(68) Project [codegen id : 26]
Output [4]: [ws_bill_customer_sk#35, ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38]
Input [5]: [ws_item_sk#34, ws_bill_customer_sk#35, ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38]

(69) Exchange
Input [4]: [ws_bill_customer_sk#35, ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38]
Arguments: hashpartitioning(ws_bill_customer_sk#35, 5), ENSURE_REQUIREMENTS, [plan_id=9]

(70) Sort [codegen id : 27]
Input [4]: [ws_bill_customer_sk#35, ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38]
Arguments: [ws_bill_customer_sk#35 ASC NULLS FIRST], false, 0

(71) ReusedExchange [Reuses operator id: 33]
Output [3]: [ss_customer_sk#46, ss_quantity#47, ss_sales_price#48]

(72) Sort [codegen id : 29]
Input [3]: [ss_customer_sk#46, ss_quantity#47, ss_sales_price#48]
Arguments: [ss_customer_sk#46 ASC NULLS FIRST], false, 0

(73) ReusedExchange [Reuses operator id: 38]
Output [1]: [c_customer_sk#49]

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

(75) SortMergeJoin [codegen id : 32]
Left keys [1]: [ss_customer_sk#46]
Right keys [1]: [c_customer_sk#49]
Join type: Inner
Join condition: None

(76) Project [codegen id : 32]
Output [3]: [ss_quantity#47, ss_sales_price#48, c_customer_sk#49]
Input [4]: [ss_customer_sk#46, ss_quantity#47, ss_sales_price#48, c_customer_sk#49]

(77) HashAggregate [codegen id : 32]
Input [3]: [ss_quantity#47, ss_sales_price#48, c_customer_sk#49]
Keys [1]: [c_customer_sk#49]
Functions [1]: [partial_sum((cast(ss_quantity#47 as decimal(10,0)) * ss_sales_price#48))]
Aggregate Attributes [2]: [sum#50, isEmpty#51]
Results [3]: [c_customer_sk#49, sum#52, isEmpty#53]

(78) HashAggregate [codegen id : 32]
Input [3]: [c_customer_sk#49, sum#52, isEmpty#53]
Keys [1]: [c_customer_sk#49]
Functions [1]: [sum((cast(ss_quantity#47 as decimal(10,0)) * ss_sales_price#48))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#47 as decimal(10,0)) * ss_sales_price#48))#29]
Results [2]: [c_customer_sk#49, sum((cast(ss_quantity#47 as decimal(10,0)) * ss_sales_price#48))#29 AS ssales#54]

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

(80) Project [codegen id : 32]
Output [1]: [c_customer_sk#49]
Input [2]: [c_customer_sk#49, ssales#54]

(81) Sort [codegen id : 32]
Input [1]: [c_customer_sk#49]
Arguments: [c_customer_sk#49 ASC NULLS FIRST], false, 0

(82) SortMergeJoin [codegen id : 34]
Left keys [1]: [ws_bill_customer_sk#35]
Right keys [1]: [c_customer_sk#49]
Join type: LeftSemi
Join condition: None

(83) Project [codegen id : 34]
Output [3]: [ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38]
Input [4]: [ws_bill_customer_sk#35, ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38]

(84) ReusedExchange [Reuses operator id: 95]
Output [1]: [d_date_sk#55]

(85) BroadcastHashJoin [codegen id : 34]
Left keys [1]: [ws_sold_date_sk#38]
Right keys [1]: [d_date_sk#55]
Join type: Inner
Join condition: None

(86) Project [codegen id : 34]
Output [1]: [(cast(ws_quantity#36 as decimal(10,0)) * ws_list_price#37) AS sales#56]
Input [4]: [ws_quantity#36, ws_list_price#37, ws_sold_date_sk#38, d_date_sk#55]

(87) Union

(88) HashAggregate [codegen id : 35]
Input [1]: [sales#33]
Keys: []
Functions [1]: [partial_sum(sales#33)]
Aggregate Attributes [2]: [sum#57, isEmpty#58]
Results [2]: [sum#59, isEmpty#60]

(89) Exchange
Input [2]: [sum#59, isEmpty#60]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=10]

(90) HashAggregate [codegen id : 36]
Input [2]: [sum#59, isEmpty#60]
Keys: []
Functions [1]: [sum(sales#33)]
Aggregate Attributes [1]: [sum(sales#33)#61]
Results [1]: [sum(sales#33)#61 AS sum(sales)#62]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6
BroadcastExchange (95)
+- * Project (94)
   +- * Filter (93)
      +- * ColumnarToRow (92)
         +- Scan parquet spark_catalog.default.date_dim (91)


(91) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#32, d_year#63, d_moy#64]
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>

(92) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#32, d_year#63, d_moy#64]

(93) Filter [codegen id : 1]
Input [3]: [d_date_sk#32, d_year#63, d_moy#64]
Condition : ((((isnotnull(d_year#63) AND isnotnull(d_moy#64)) AND (d_year#63 = 2000)) AND (d_moy#64 = 2)) AND isnotnull(d_date_sk#32))

(94) Project [codegen id : 1]
Output [1]: [d_date_sk#32]
Input [3]: [d_date_sk#32, d_year#63, d_moy#64]

(95) BroadcastExchange
Input [1]: [d_date_sk#32]
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 (100)
+- * Project (99)
   +- * Filter (98)
      +- * ColumnarToRow (97)
         +- Scan parquet spark_catalog.default.date_dim (96)


(96) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#10, d_date#11, d_year#65]
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>

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

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

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

(100) 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 = 44 Hosting Expression = Subquery scalar-subquery#31, [id=#7]
* HashAggregate (117)
+- Exchange (116)
   +- * HashAggregate (115)
      +- * HashAggregate (114)
         +- * HashAggregate (113)
            +- * Project (112)
               +- * SortMergeJoin Inner (111)
                  :- * Sort (108)
                  :  +- Exchange (107)
                  :     +- * Project (106)
                  :        +- * BroadcastHashJoin Inner BuildRight (105)
                  :           :- * Filter (103)
                  :           :  +- * ColumnarToRow (102)
                  :           :     +- Scan parquet spark_catalog.default.store_sales (101)
                  :           +- ReusedExchange (104)
                  +- * Sort (110)
                     +- ReusedExchange (109)


(101) Scan parquet spark_catalog.default.store_sales
Output [4]: [ss_customer_sk#66, ss_quantity#67, ss_sales_price#68, ss_sold_date_sk#69]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#69), dynamicpruningexpression(ss_sold_date_sk#69 IN dynamicpruning#70)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_quantity:int,ss_sales_price:decimal(7,2)>

(102) ColumnarToRow [codegen id : 2]
Input [4]: [ss_customer_sk#66, ss_quantity#67, ss_sales_price#68, ss_sold_date_sk#69]

(103) Filter [codegen id : 2]
Input [4]: [ss_customer_sk#66, ss_quantity#67, ss_sales_price#68, ss_sold_date_sk#69]
Condition : isnotnull(ss_customer_sk#66)

(104) ReusedExchange [Reuses operator id: 122]
Output [1]: [d_date_sk#71]

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

(106) Project [codegen id : 2]
Output [3]: [ss_customer_sk#66, ss_quantity#67, ss_sales_price#68]
Input [5]: [ss_customer_sk#66, ss_quantity#67, ss_sales_price#68, ss_sold_date_sk#69, d_date_sk#71]

(107) Exchange
Input [3]: [ss_customer_sk#66, ss_quantity#67, ss_sales_price#68]
Arguments: hashpartitioning(ss_customer_sk#66, 5), ENSURE_REQUIREMENTS, [plan_id=13]

(108) Sort [codegen id : 3]
Input [3]: [ss_customer_sk#66, ss_quantity#67, ss_sales_price#68]
Arguments: [ss_customer_sk#66 ASC NULLS FIRST], false, 0

(109) ReusedExchange [Reuses operator id: 38]
Output [1]: [c_customer_sk#72]

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

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

(112) Project [codegen id : 6]
Output [3]: [ss_quantity#67, ss_sales_price#68, c_customer_sk#72]
Input [4]: [ss_customer_sk#66, ss_quantity#67, ss_sales_price#68, c_customer_sk#72]

(113) HashAggregate [codegen id : 6]
Input [3]: [ss_quantity#67, ss_sales_price#68, c_customer_sk#72]
Keys [1]: [c_customer_sk#72]
Functions [1]: [partial_sum((cast(ss_quantity#67 as decimal(10,0)) * ss_sales_price#68))]
Aggregate Attributes [2]: [sum#73, isEmpty#74]
Results [3]: [c_customer_sk#72, sum#75, isEmpty#76]

(114) HashAggregate [codegen id : 6]
Input [3]: [c_customer_sk#72, sum#75, isEmpty#76]
Keys [1]: [c_customer_sk#72]
Functions [1]: [sum((cast(ss_quantity#67 as decimal(10,0)) * ss_sales_price#68))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#67 as decimal(10,0)) * ss_sales_price#68))#77]
Results [1]: [sum((cast(ss_quantity#67 as decimal(10,0)) * ss_sales_price#68))#77 AS csales#78]

(115) HashAggregate [codegen id : 6]
Input [1]: [csales#78]
Keys: []
Functions [1]: [partial_max(csales#78)]
Aggregate Attributes [1]: [max#79]
Results [1]: [max#80]

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

(117) HashAggregate [codegen id : 7]
Input [1]: [max#80]
Keys: []
Functions [1]: [max(csales#78)]
Aggregate Attributes [1]: [max(csales#78)#81]
Results [1]: [max(csales#78)#81 AS tpcds_cmax#82]

Subquery:4 Hosting operator id = 101 Hosting Expression = ss_sold_date_sk#69 IN dynamicpruning#70
BroadcastExchange (122)
+- * Project (121)
   +- * Filter (120)
      +- * ColumnarToRow (119)
         +- Scan parquet spark_catalog.default.date_dim (118)


(118) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#71, d_year#83]
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>

(119) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#71, d_year#83]

(120) Filter [codegen id : 1]
Input [2]: [d_date_sk#71, d_year#83]
Condition : (d_year#83 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#71))

(121) Project [codegen id : 1]
Output [1]: [d_date_sk#71]
Input [2]: [d_date_sk#71, d_year#83]

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

Subquery:5 Hosting operator id = 52 Hosting Expression = ws_sold_date_sk#38 IN dynamicpruning#6

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


