== Physical Plan ==
TakeOrderedAndProject (136)
+- Union (135)
   :- * HashAggregate (80)
   :  +- Exchange (79)
   :     +- * HashAggregate (78)
   :        +- * Project (77)
   :           +- * SortMergeJoin Inner (76)
   :              :- * Project (58)
   :              :  +- * BroadcastHashJoin Inner BuildRight (57)
   :              :     :- SortMergeJoin LeftSemi (51)
   :              :     :  :- * Sort (33)
   :              :     :  :  +- Exchange (32)
   :              :     :  :     +- * Project (31)
   :              :     :  :        +- SortMergeJoin LeftSemi (30)
   :              :     :  :           :- * Sort (5)
   :              :     :  :           :  +- Exchange (4)
   :              :     :  :           :     +- * Filter (3)
   :              :     :  :           :        +- * ColumnarToRow (2)
   :              :     :  :           :           +- Scan parquet default.catalog_sales (1)
   :              :     :  :           +- * Sort (29)
   :              :     :  :              +- * Project (28)
   :              :     :  :                 +- * Filter (27)
   :              :     :  :                    +- * HashAggregate (26)
   :              :     :  :                       +- * HashAggregate (25)
   :              :     :  :                          +- * Project (24)
   :              :     :  :                             +- * SortMergeJoin Inner (23)
   :              :     :  :                                :- * Sort (17)
   :              :     :  :                                :  +- Exchange (16)
   :              :     :  :                                :     +- * Project (15)
   :              :     :  :                                :        +- * BroadcastHashJoin Inner BuildRight (14)
   :              :     :  :                                :           :- * Filter (8)
   :              :     :  :                                :           :  +- * ColumnarToRow (7)
   :              :     :  :                                :           :     +- Scan parquet default.store_sales (6)
   :              :     :  :                                :           +- BroadcastExchange (13)
   :              :     :  :                                :              +- * Project (12)
   :              :     :  :                                :                 +- * Filter (11)
   :              :     :  :                                :                    +- * ColumnarToRow (10)
   :              :     :  :                                :                       +- Scan parquet default.date_dim (9)
   :              :     :  :                                +- * Sort (22)
   :              :     :  :                                   +- Exchange (21)
   :              :     :  :                                      +- * Filter (20)
   :              :     :  :                                         +- * ColumnarToRow (19)
   :              :     :  :                                            +- Scan parquet default.item (18)
   :              :     :  +- * Sort (50)
   :              :     :     +- * Project (49)
   :              :     :        +- * Filter (48)
   :              :     :           +- * HashAggregate (47)
   :              :     :              +- * HashAggregate (46)
   :              :     :                 +- * Project (45)
   :              :     :                    +- * SortMergeJoin Inner (44)
   :              :     :                       :- * Sort (38)
   :              :     :                       :  +- Exchange (37)
   :              :     :                       :     +- * Filter (36)
   :              :     :                       :        +- * ColumnarToRow (35)
   :              :     :                       :           +- Scan parquet default.store_sales (34)
   :              :     :                       +- * Sort (43)
   :              :     :                          +- Exchange (42)
   :              :     :                             +- * Filter (41)
   :              :     :                                +- * ColumnarToRow (40)
   :              :     :                                   +- Scan parquet default.customer (39)
   :              :     +- BroadcastExchange (56)
   :              :        +- * Project (55)
   :              :           +- * Filter (54)
   :              :              +- * ColumnarToRow (53)
   :              :                 +- Scan parquet default.date_dim (52)
   :              +- SortMergeJoin LeftSemi (75)
   :                 :- * Sort (63)
   :                 :  +- Exchange (62)
   :                 :     +- * Filter (61)
   :                 :        +- * ColumnarToRow (60)
   :                 :           +- Scan parquet default.customer (59)
   :                 +- * Sort (74)
   :                    +- * Project (73)
   :                       +- * Filter (72)
   :                          +- * HashAggregate (71)
   :                             +- * HashAggregate (70)
   :                                +- * Project (69)
   :                                   +- * SortMergeJoin Inner (68)
   :                                      :- * Sort (65)
   :                                      :  +- ReusedExchange (64)
   :                                      +- * Sort (67)
   :                                         +- ReusedExchange (66)
   +- * HashAggregate (134)
      +- Exchange (133)
         +- * HashAggregate (132)
            +- * Project (131)
               +- * SortMergeJoin Inner (130)
                  :- * Project (115)
                  :  +- * BroadcastHashJoin Inner BuildRight (114)
                  :     :- SortMergeJoin LeftSemi (112)
                  :     :  :- * Sort (100)
                  :     :  :  +- Exchange (99)
                  :     :  :     +- * Project (98)
                  :     :  :        +- SortMergeJoin LeftSemi (97)
                  :     :  :           :- * Sort (85)
                  :     :  :           :  +- Exchange (84)
                  :     :  :           :     +- * Filter (83)
                  :     :  :           :        +- * ColumnarToRow (82)
                  :     :  :           :           +- Scan parquet default.web_sales (81)
                  :     :  :           +- * Sort (96)
                  :     :  :              +- * Project (95)
                  :     :  :                 +- * Filter (94)
                  :     :  :                    +- * HashAggregate (93)
                  :     :  :                       +- * HashAggregate (92)
                  :     :  :                          +- * Project (91)
                  :     :  :                             +- * SortMergeJoin Inner (90)
                  :     :  :                                :- * Sort (87)
                  :     :  :                                :  +- ReusedExchange (86)
                  :     :  :                                +- * Sort (89)
                  :     :  :                                   +- ReusedExchange (88)
                  :     :  +- * Sort (111)
                  :     :     +- * Project (110)
                  :     :        +- * Filter (109)
                  :     :           +- * HashAggregate (108)
                  :     :              +- * HashAggregate (107)
                  :     :                 +- * Project (106)
                  :     :                    +- * SortMergeJoin Inner (105)
                  :     :                       :- * Sort (102)
                  :     :                       :  +- ReusedExchange (101)
                  :     :                       +- * Sort (104)
                  :     :                          +- ReusedExchange (103)
                  :     +- ReusedExchange (113)
                  +- SortMergeJoin LeftSemi (129)
                     :- * Sort (117)
                     :  +- ReusedExchange (116)
                     +- * Sort (128)
                        +- * Project (127)
                           +- * Filter (126)
                              +- * HashAggregate (125)
                                 +- * HashAggregate (124)
                                    +- * Project (123)
                                       +- * SortMergeJoin Inner (122)
                                          :- * Sort (119)
                                          :  +- ReusedExchange (118)
                                          +- * Sort (121)
                                             +- ReusedExchange (120)


(1) Scan parquet default.catalog_sales
Output [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5]
Batched: true
Location [not included in comparison]/{warehouse_dir}/catalog_sales]
PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)]
ReadSchema: struct<cs_sold_date_sk:int,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_sold_date_sk#1, cs_bill_customer_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5]

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

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

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

(6) Scan parquet default.store_sales
Output [2]: [ss_sold_date_sk#7, ss_item_sk#8]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_sold_date_sk:int,ss_item_sk:int>

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

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

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

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

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

(12) Project [codegen id : 3]
Output [2]: [d_date_sk#9, d_date#10]
Input [3]: [d_date_sk#9, d_date#10, d_year#11]

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

(14) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [ss_sold_date_sk#7]
Right keys [1]: [d_date_sk#9]
Join condition: None

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

(16) Exchange
Input [2]: [ss_item_sk#8, d_date#10]
Arguments: hashpartitioning(ss_item_sk#8, 5), true, [id=#13]

(17) Sort [codegen id : 5]
Input [2]: [ss_item_sk#8, d_date#10]
Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0

(18) Scan parquet default.item
Output [2]: [i_item_sk#14, i_item_desc#15]
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>

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

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

(21) Exchange
Input [2]: [i_item_sk#14, i_item_desc#15]
Arguments: hashpartitioning(i_item_sk#14, 5), true, [id=#16]

(22) Sort [codegen id : 7]
Input [2]: [i_item_sk#14, i_item_desc#15]
Arguments: [i_item_sk#14 ASC NULLS FIRST], false, 0

(23) SortMergeJoin [codegen id : 8]
Left keys [1]: [ss_item_sk#8]
Right keys [1]: [i_item_sk#14]
Join condition: None

(24) Project [codegen id : 8]
Output [3]: [d_date#10, i_item_sk#14, i_item_desc#15]
Input [4]: [ss_item_sk#8, d_date#10, i_item_sk#14, i_item_desc#15]

(25) HashAggregate [codegen id : 8]
Input [3]: [d_date#10, i_item_sk#14, i_item_desc#15]
Keys [3]: [substr(i_item_desc#15, 1, 30) AS substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#18]
Results [4]: [substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10, count#19]

(26) HashAggregate [codegen id : 8]
Input [4]: [substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10, count#19]
Keys [3]: [substr(i_item_desc#15, 1, 30)#17, i_item_sk#14, d_date#10]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#20]
Results [2]: [i_item_sk#14 AS item_sk#21, count(1)#20 AS count(1)#22]

(27) Filter [codegen id : 8]
Input [2]: [item_sk#21, count(1)#22]
Condition : (count(1)#22 > 4)

(28) Project [codegen id : 8]
Output [1]: [item_sk#21]
Input [2]: [item_sk#21, count(1)#22]

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

(30) SortMergeJoin
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [item_sk#21]
Join condition: None

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

(32) Exchange
Input [4]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5]
Arguments: hashpartitioning(cs_bill_customer_sk#2, 5), true, [id=#23]

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

(34) Scan parquet default.store_sales
Output [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
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)>

(35) ColumnarToRow [codegen id : 11]
Input [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]

(36) Filter [codegen id : 11]
Input [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Condition : isnotnull(ss_customer_sk#24)

(37) Exchange
Input [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Arguments: hashpartitioning(ss_customer_sk#24, 5), true, [id=#27]

(38) Sort [codegen id : 12]
Input [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Arguments: [ss_customer_sk#24 ASC NULLS FIRST], false, 0

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

(40) ColumnarToRow [codegen id : 13]
Input [1]: [c_customer_sk#28]

(41) Filter [codegen id : 13]
Input [1]: [c_customer_sk#28]
Condition : isnotnull(c_customer_sk#28)

(42) Exchange
Input [1]: [c_customer_sk#28]
Arguments: hashpartitioning(c_customer_sk#28, 5), true, [id=#29]

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

(44) SortMergeJoin [codegen id : 15]
Left keys [1]: [ss_customer_sk#24]
Right keys [1]: [c_customer_sk#28]
Join condition: None

(45) Project [codegen id : 15]
Output [3]: [ss_quantity#25, ss_sales_price#26, c_customer_sk#28]
Input [4]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26, c_customer_sk#28]

(46) HashAggregate [codegen id : 15]
Input [3]: [ss_quantity#25, ss_sales_price#26, c_customer_sk#28]
Keys [1]: [c_customer_sk#28]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [2]: [sum#30, isEmpty#31]
Results [3]: [c_customer_sk#28, sum#32, isEmpty#33]

(47) HashAggregate [codegen id : 15]
Input [3]: [c_customer_sk#28, sum#32, isEmpty#33]
Keys [1]: [c_customer_sk#28]
Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#34]
Results [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#34 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#35]

(48) Filter [codegen id : 15]
Input [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#35]
Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#35) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#35 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(Subquery scalar-subquery#36, [id=#37] as decimal(32,6)))), DecimalType(38,8), true)))

(49) Project [codegen id : 15]
Output [1]: [c_customer_sk#28]
Input [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#35]

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

(51) SortMergeJoin
Left keys [1]: [cs_bill_customer_sk#2]
Right keys [1]: [c_customer_sk#28]
Join condition: None

(52) Scan parquet default.date_dim
Output [3]: [d_date_sk#9, d_year#11, d_moy#38]
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>

(53) ColumnarToRow [codegen id : 16]
Input [3]: [d_date_sk#9, d_year#11, d_moy#38]

(54) Filter [codegen id : 16]
Input [3]: [d_date_sk#9, d_year#11, d_moy#38]
Condition : ((((isnotnull(d_year#11) AND isnotnull(d_moy#38)) AND (d_year#11 = 2000)) AND (d_moy#38 = 2)) AND isnotnull(d_date_sk#9))

(55) Project [codegen id : 16]
Output [1]: [d_date_sk#9]
Input [3]: [d_date_sk#9, d_year#11, d_moy#38]

(56) BroadcastExchange
Input [1]: [d_date_sk#9]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#39]

(57) BroadcastHashJoin [codegen id : 17]
Left keys [1]: [cs_sold_date_sk#1]
Right keys [1]: [d_date_sk#9]
Join condition: None

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

(59) Scan parquet default.customer
Output [3]: [c_customer_sk#28, c_first_name#40, c_last_name#41]
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>

(60) ColumnarToRow [codegen id : 18]
Input [3]: [c_customer_sk#28, c_first_name#40, c_last_name#41]

(61) Filter [codegen id : 18]
Input [3]: [c_customer_sk#28, c_first_name#40, c_last_name#41]
Condition : isnotnull(c_customer_sk#28)

(62) Exchange
Input [3]: [c_customer_sk#28, c_first_name#40, c_last_name#41]
Arguments: hashpartitioning(c_customer_sk#28, 5), true, [id=#42]

(63) Sort [codegen id : 19]
Input [3]: [c_customer_sk#28, c_first_name#40, c_last_name#41]
Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0

(64) ReusedExchange [Reuses operator id: 37]
Output [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]

(65) Sort [codegen id : 21]
Input [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Arguments: [ss_customer_sk#24 ASC NULLS FIRST], false, 0

(66) ReusedExchange [Reuses operator id: 42]
Output [1]: [c_customer_sk#28]

(67) Sort [codegen id : 23]
Input [1]: [c_customer_sk#28]
Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0

(68) SortMergeJoin [codegen id : 24]
Left keys [1]: [ss_customer_sk#24]
Right keys [1]: [c_customer_sk#28]
Join condition: None

(69) Project [codegen id : 24]
Output [3]: [ss_quantity#25, ss_sales_price#26, c_customer_sk#28]
Input [4]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26, c_customer_sk#28]

(70) HashAggregate [codegen id : 24]
Input [3]: [ss_quantity#25, ss_sales_price#26, c_customer_sk#28]
Keys [1]: [c_customer_sk#28]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [2]: [sum#30, isEmpty#31]
Results [3]: [c_customer_sk#28, sum#32, isEmpty#33]

(71) HashAggregate [codegen id : 24]
Input [3]: [c_customer_sk#28, sum#32, isEmpty#33]
Keys [1]: [c_customer_sk#28]
Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#34]
Results [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#34 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#35]

(72) Filter [codegen id : 24]
Input [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#35]
Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#35) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#35 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#36, [id=#37] as decimal(32,6)))), DecimalType(38,8), true)))

(73) Project [codegen id : 24]
Output [1]: [c_customer_sk#28 AS c_customer_sk#28#43]
Input [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#35]

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

(75) SortMergeJoin
Left keys [1]: [c_customer_sk#28]
Right keys [1]: [c_customer_sk#28#43]
Join condition: None

(76) SortMergeJoin [codegen id : 25]
Left keys [1]: [cs_bill_customer_sk#2]
Right keys [1]: [c_customer_sk#28]
Join condition: None

(77) Project [codegen id : 25]
Output [4]: [cs_quantity#4, cs_list_price#5, c_first_name#40, c_last_name#41]
Input [6]: [cs_bill_customer_sk#2, cs_quantity#4, cs_list_price#5, c_customer_sk#28, c_first_name#40, c_last_name#41]

(78) HashAggregate [codegen id : 25]
Input [4]: [cs_quantity#4, cs_list_price#5, c_first_name#40, c_last_name#41]
Keys [2]: [c_last_name#41, c_first_name#40]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [2]: [sum#44, isEmpty#45]
Results [4]: [c_last_name#41, c_first_name#40, sum#46, isEmpty#47]

(79) Exchange
Input [4]: [c_last_name#41, c_first_name#40, sum#46, isEmpty#47]
Arguments: hashpartitioning(c_last_name#41, c_first_name#40, 5), true, [id=#48]

(80) HashAggregate [codegen id : 26]
Input [4]: [c_last_name#41, c_first_name#40, sum#46, isEmpty#47]
Keys [2]: [c_last_name#41, c_first_name#40]
Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))#49]
Results [3]: [c_last_name#41, c_first_name#40, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#5 as decimal(12,2)))), DecimalType(18,2), true))#49 AS sales#50]

(81) Scan parquet default.web_sales
Output [5]: [ws_sold_date_sk#51, ws_item_sk#52, ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_sales]
PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)]
ReadSchema: struct<ws_sold_date_sk:int,ws_item_sk:int,ws_bill_customer_sk:int,ws_quantity:int,ws_list_price:decimal(7,2)>

(82) ColumnarToRow [codegen id : 27]
Input [5]: [ws_sold_date_sk#51, ws_item_sk#52, ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55]

(83) Filter [codegen id : 27]
Input [5]: [ws_sold_date_sk#51, ws_item_sk#52, ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55]
Condition : (isnotnull(ws_bill_customer_sk#53) AND isnotnull(ws_sold_date_sk#51))

(84) Exchange
Input [5]: [ws_sold_date_sk#51, ws_item_sk#52, ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55]
Arguments: hashpartitioning(ws_item_sk#52, 5), true, [id=#56]

(85) Sort [codegen id : 28]
Input [5]: [ws_sold_date_sk#51, ws_item_sk#52, ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55]
Arguments: [ws_item_sk#52 ASC NULLS FIRST], false, 0

(86) ReusedExchange [Reuses operator id: 16]
Output [2]: [ss_item_sk#8, d_date#10]

(87) Sort [codegen id : 31]
Input [2]: [ss_item_sk#8, d_date#10]
Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0

(88) ReusedExchange [Reuses operator id: 21]
Output [2]: [i_item_sk#14, i_item_desc#15]

(89) Sort [codegen id : 33]
Input [2]: [i_item_sk#14, i_item_desc#15]
Arguments: [i_item_sk#14 ASC NULLS FIRST], false, 0

(90) SortMergeJoin [codegen id : 34]
Left keys [1]: [ss_item_sk#8]
Right keys [1]: [i_item_sk#14]
Join condition: None

(91) Project [codegen id : 34]
Output [3]: [d_date#10, i_item_sk#14, i_item_desc#15]
Input [4]: [ss_item_sk#8, d_date#10, i_item_sk#14, i_item_desc#15]

(92) HashAggregate [codegen id : 34]
Input [3]: [d_date#10, i_item_sk#14, i_item_desc#15]
Keys [3]: [substr(i_item_desc#15, 1, 30) AS substr(i_item_desc#15, 1, 30)#57, i_item_sk#14, d_date#10]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#58]
Results [4]: [substr(i_item_desc#15, 1, 30)#57, i_item_sk#14, d_date#10, count#59]

(93) HashAggregate [codegen id : 34]
Input [4]: [substr(i_item_desc#15, 1, 30)#57, i_item_sk#14, d_date#10, count#59]
Keys [3]: [substr(i_item_desc#15, 1, 30)#57, i_item_sk#14, d_date#10]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#60]
Results [2]: [i_item_sk#14 AS item_sk#21, count(1)#60 AS count(1)#61]

(94) Filter [codegen id : 34]
Input [2]: [item_sk#21, count(1)#61]
Condition : (count(1)#61 > 4)

(95) Project [codegen id : 34]
Output [1]: [item_sk#21]
Input [2]: [item_sk#21, count(1)#61]

(96) Sort [codegen id : 34]
Input [1]: [item_sk#21]
Arguments: [item_sk#21 ASC NULLS FIRST], false, 0

(97) SortMergeJoin
Left keys [1]: [ws_item_sk#52]
Right keys [1]: [item_sk#21]
Join condition: None

(98) Project [codegen id : 35]
Output [4]: [ws_sold_date_sk#51, ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55]
Input [5]: [ws_sold_date_sk#51, ws_item_sk#52, ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55]

(99) Exchange
Input [4]: [ws_sold_date_sk#51, ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55]
Arguments: hashpartitioning(ws_bill_customer_sk#53, 5), true, [id=#62]

(100) Sort [codegen id : 36]
Input [4]: [ws_sold_date_sk#51, ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55]
Arguments: [ws_bill_customer_sk#53 ASC NULLS FIRST], false, 0

(101) ReusedExchange [Reuses operator id: 37]
Output [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]

(102) Sort [codegen id : 38]
Input [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Arguments: [ss_customer_sk#24 ASC NULLS FIRST], false, 0

(103) ReusedExchange [Reuses operator id: 42]
Output [1]: [c_customer_sk#28]

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

(105) SortMergeJoin [codegen id : 41]
Left keys [1]: [ss_customer_sk#24]
Right keys [1]: [c_customer_sk#28]
Join condition: None

(106) Project [codegen id : 41]
Output [3]: [ss_quantity#25, ss_sales_price#26, c_customer_sk#28]
Input [4]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26, c_customer_sk#28]

(107) HashAggregate [codegen id : 41]
Input [3]: [ss_quantity#25, ss_sales_price#26, c_customer_sk#28]
Keys [1]: [c_customer_sk#28]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [2]: [sum#63, isEmpty#64]
Results [3]: [c_customer_sk#28, sum#65, isEmpty#66]

(108) HashAggregate [codegen id : 41]
Input [3]: [c_customer_sk#28, sum#65, isEmpty#66]
Keys [1]: [c_customer_sk#28]
Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#67]
Results [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#67 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#68]

(109) Filter [codegen id : 41]
Input [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#68]
Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#68) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#68 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#36, [id=#37] as decimal(32,6)))), DecimalType(38,8), true)))

(110) Project [codegen id : 41]
Output [1]: [c_customer_sk#28]
Input [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#68]

(111) Sort [codegen id : 41]
Input [1]: [c_customer_sk#28]
Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0

(112) SortMergeJoin
Left keys [1]: [ws_bill_customer_sk#53]
Right keys [1]: [c_customer_sk#28]
Join condition: None

(113) ReusedExchange [Reuses operator id: 56]
Output [1]: [d_date_sk#9]

(114) BroadcastHashJoin [codegen id : 43]
Left keys [1]: [ws_sold_date_sk#51]
Right keys [1]: [d_date_sk#9]
Join condition: None

(115) Project [codegen id : 43]
Output [3]: [ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55]
Input [5]: [ws_sold_date_sk#51, ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55, d_date_sk#9]

(116) ReusedExchange [Reuses operator id: 62]
Output [3]: [c_customer_sk#28, c_first_name#40, c_last_name#41]

(117) Sort [codegen id : 45]
Input [3]: [c_customer_sk#28, c_first_name#40, c_last_name#41]
Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0

(118) ReusedExchange [Reuses operator id: 37]
Output [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]

(119) Sort [codegen id : 47]
Input [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Arguments: [ss_customer_sk#24 ASC NULLS FIRST], false, 0

(120) ReusedExchange [Reuses operator id: 42]
Output [1]: [c_customer_sk#28]

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

(122) SortMergeJoin [codegen id : 50]
Left keys [1]: [ss_customer_sk#24]
Right keys [1]: [c_customer_sk#28]
Join condition: None

(123) Project [codegen id : 50]
Output [3]: [ss_quantity#25, ss_sales_price#26, c_customer_sk#28]
Input [4]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26, c_customer_sk#28]

(124) HashAggregate [codegen id : 50]
Input [3]: [ss_quantity#25, ss_sales_price#26, c_customer_sk#28]
Keys [1]: [c_customer_sk#28]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [2]: [sum#63, isEmpty#64]
Results [3]: [c_customer_sk#28, sum#65, isEmpty#66]

(125) HashAggregate [codegen id : 50]
Input [3]: [c_customer_sk#28, sum#65, isEmpty#66]
Keys [1]: [c_customer_sk#28]
Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#67]
Results [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#67 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#68]

(126) Filter [codegen id : 50]
Input [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#68]
Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#68) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#68 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#36, [id=#37] as decimal(32,6)))), DecimalType(38,8), true)))

(127) Project [codegen id : 50]
Output [1]: [c_customer_sk#28 AS c_customer_sk#28#69]
Input [2]: [c_customer_sk#28, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#68]

(128) Sort [codegen id : 50]
Input [1]: [c_customer_sk#28#69]
Arguments: [c_customer_sk#28#69 ASC NULLS FIRST], false, 0

(129) SortMergeJoin
Left keys [1]: [c_customer_sk#28]
Right keys [1]: [c_customer_sk#28#69]
Join condition: None

(130) SortMergeJoin [codegen id : 51]
Left keys [1]: [ws_bill_customer_sk#53]
Right keys [1]: [c_customer_sk#28]
Join condition: None

(131) Project [codegen id : 51]
Output [4]: [ws_quantity#54, ws_list_price#55, c_first_name#40, c_last_name#41]
Input [6]: [ws_bill_customer_sk#53, ws_quantity#54, ws_list_price#55, c_customer_sk#28, c_first_name#40, c_last_name#41]

(132) HashAggregate [codegen id : 51]
Input [4]: [ws_quantity#54, ws_list_price#55, c_first_name#40, c_last_name#41]
Keys [2]: [c_last_name#41, c_first_name#40]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#54 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#55 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [2]: [sum#70, isEmpty#71]
Results [4]: [c_last_name#41, c_first_name#40, sum#72, isEmpty#73]

(133) Exchange
Input [4]: [c_last_name#41, c_first_name#40, sum#72, isEmpty#73]
Arguments: hashpartitioning(c_last_name#41, c_first_name#40, 5), true, [id=#74]

(134) HashAggregate [codegen id : 52]
Input [4]: [c_last_name#41, c_first_name#40, sum#72, isEmpty#73]
Keys [2]: [c_last_name#41, c_first_name#40]
Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#54 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#55 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#54 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#55 as decimal(12,2)))), DecimalType(18,2), true))#75]
Results [3]: [c_last_name#41, c_first_name#40, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#54 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#55 as decimal(12,2)))), DecimalType(18,2), true))#75 AS sales#76]

(135) Union

(136) TakeOrderedAndProject
Input [3]: [c_last_name#41, c_first_name#40, sales#50]
Arguments: 100, [c_last_name#41 ASC NULLS FIRST, c_first_name#40 ASC NULLS FIRST, sales#50 ASC NULLS FIRST], [c_last_name#41, c_first_name#40, sales#50]

===== Subqueries =====

Subquery:1 Hosting operator id = 48 Hosting Expression = Subquery scalar-subquery#36, [id=#37]
* HashAggregate (160)
+- Exchange (159)
   +- * HashAggregate (158)
      +- * HashAggregate (157)
         +- * HashAggregate (156)
            +- * Project (155)
               +- * SortMergeJoin Inner (154)
                  :- * Sort (148)
                  :  +- Exchange (147)
                  :     +- * Project (146)
                  :        +- * BroadcastHashJoin Inner BuildRight (145)
                  :           :- * Filter (139)
                  :           :  +- * ColumnarToRow (138)
                  :           :     +- Scan parquet default.store_sales (137)
                  :           +- BroadcastExchange (144)
                  :              +- * Project (143)
                  :                 +- * Filter (142)
                  :                    +- * ColumnarToRow (141)
                  :                       +- Scan parquet default.date_dim (140)
                  +- * Sort (153)
                     +- Exchange (152)
                        +- * Filter (151)
                           +- * ColumnarToRow (150)
                              +- Scan parquet default.customer (149)


(137) Scan parquet default.store_sales
Output [4]: [ss_sold_date_sk#7, ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)]
ReadSchema: struct<ss_sold_date_sk:int,ss_customer_sk:int,ss_quantity:int,ss_sales_price:decimal(7,2)>

(138) ColumnarToRow [codegen id : 2]
Input [4]: [ss_sold_date_sk#7, ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]

(139) Filter [codegen id : 2]
Input [4]: [ss_sold_date_sk#7, ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Condition : (isnotnull(ss_customer_sk#24) AND isnotnull(ss_sold_date_sk#7))

(140) Scan parquet default.date_dim
Output [2]: [d_date_sk#9, d_year#11]
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>

(141) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#9, d_year#11]

(142) Filter [codegen id : 1]
Input [2]: [d_date_sk#9, d_year#11]
Condition : (d_year#11 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#9))

(143) Project [codegen id : 1]
Output [1]: [d_date_sk#9]
Input [2]: [d_date_sk#9, d_year#11]

(144) BroadcastExchange
Input [1]: [d_date_sk#9]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#77]

(145) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [ss_sold_date_sk#7]
Right keys [1]: [d_date_sk#9]
Join condition: None

(146) Project [codegen id : 2]
Output [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Input [5]: [ss_sold_date_sk#7, ss_customer_sk#24, ss_quantity#25, ss_sales_price#26, d_date_sk#9]

(147) Exchange
Input [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Arguments: hashpartitioning(ss_customer_sk#24, 5), true, [id=#78]

(148) Sort [codegen id : 3]
Input [3]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26]
Arguments: [ss_customer_sk#24 ASC NULLS FIRST], false, 0

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

(150) ColumnarToRow [codegen id : 4]
Input [1]: [c_customer_sk#28]

(151) Filter [codegen id : 4]
Input [1]: [c_customer_sk#28]
Condition : isnotnull(c_customer_sk#28)

(152) Exchange
Input [1]: [c_customer_sk#28]
Arguments: hashpartitioning(c_customer_sk#28, 5), true, [id=#79]

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

(154) SortMergeJoin [codegen id : 6]
Left keys [1]: [ss_customer_sk#24]
Right keys [1]: [c_customer_sk#28]
Join condition: None

(155) Project [codegen id : 6]
Output [3]: [ss_quantity#25, ss_sales_price#26, c_customer_sk#28]
Input [4]: [ss_customer_sk#24, ss_quantity#25, ss_sales_price#26, c_customer_sk#28]

(156) HashAggregate [codegen id : 6]
Input [3]: [ss_quantity#25, ss_sales_price#26, c_customer_sk#28]
Keys [1]: [c_customer_sk#28]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [2]: [sum#80, isEmpty#81]
Results [3]: [c_customer_sk#28, sum#82, isEmpty#83]

(157) HashAggregate [codegen id : 6]
Input [3]: [c_customer_sk#28, sum#82, isEmpty#83]
Keys [1]: [c_customer_sk#28]
Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#84]
Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#25 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#26 as decimal(12,2)))), DecimalType(18,2), true))#84 AS csales#85]

(158) HashAggregate [codegen id : 6]
Input [1]: [csales#85]
Keys: []
Functions [1]: [partial_max(csales#85)]
Aggregate Attributes [1]: [max#86]
Results [1]: [max#87]

(159) Exchange
Input [1]: [max#87]
Arguments: SinglePartition, true, [id=#88]

(160) HashAggregate [codegen id : 7]
Input [1]: [max#87]
Keys: []
Functions [1]: [max(csales#85)]
Aggregate Attributes [1]: [max(csales#85)#89]
Results [1]: [max(csales#85)#89 AS tpcds_cmax#90]

Subquery:2 Hosting operator id = 72 Hosting Expression = ReusedSubquery Subquery scalar-subquery#36, [id=#37]

Subquery:3 Hosting operator id = 109 Hosting Expression = ReusedSubquery Subquery scalar-subquery#36, [id=#37]

Subquery:4 Hosting operator id = 126 Hosting Expression = ReusedSubquery Subquery scalar-subquery#36, [id=#37]


