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


(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_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 : 9]
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 : 9]
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_sold_date_sk#1)

(4) Scan parquet default.store_sales
Output [2]: [ss_sold_date_sk#6, ss_item_sk#7]
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>

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

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

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

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

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

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

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

(12) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ss_sold_date_sk#6]
Right keys [1]: [d_date_sk#8]
Join condition: None

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

(14) Scan parquet 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>

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

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

(17) BroadcastExchange
Input [2]: [i_item_sk#12, i_item_desc#13]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14]

(18) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ss_item_sk#7]
Right keys [1]: [i_item_sk#12]
Join condition: None

(19) Project [codegen id : 3]
Output [3]: [d_date#9, i_item_sk#12, i_item_desc#13]
Input [4]: [ss_item_sk#7, d_date#9, i_item_sk#12, i_item_desc#13]

(20) HashAggregate [codegen id : 3]
Input [3]: [d_date#9, i_item_sk#12, i_item_desc#13]
Keys [3]: [substr(i_item_desc#13, 1, 30) AS substr(i_item_desc#13, 1, 30)#15, i_item_sk#12, d_date#9]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#16]
Results [4]: [substr(i_item_desc#13, 1, 30)#15, i_item_sk#12, d_date#9, count#17]

(21) Exchange
Input [4]: [substr(i_item_desc#13, 1, 30)#15, i_item_sk#12, d_date#9, count#17]
Arguments: hashpartitioning(substr(i_item_desc#13, 1, 30)#15, i_item_sk#12, d_date#9, 5), true, [id=#18]

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

(23) Filter [codegen id : 4]
Input [2]: [item_sk#20, count(1)#21]
Condition : (count(1)#21 > 4)

(24) Project [codegen id : 4]
Output [1]: [item_sk#20]
Input [2]: [item_sk#20, count(1)#21]

(25) BroadcastExchange
Input [1]: [item_sk#20]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22]

(26) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [cs_item_sk#3]
Right keys [1]: [item_sk#20]
Join condition: None

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

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

(30) Filter [codegen id : 6]
Input [3]: [ss_customer_sk#23, ss_quantity#24, ss_sales_price#25]
Condition : isnotnull(ss_customer_sk#23)

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

(32) ColumnarToRow [codegen id : 5]
Input [1]: [c_customer_sk#26]

(33) Filter [codegen id : 5]
Input [1]: [c_customer_sk#26]
Condition : isnotnull(c_customer_sk#26)

(34) BroadcastExchange
Input [1]: [c_customer_sk#26]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27]

(35) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_customer_sk#23]
Right keys [1]: [c_customer_sk#26]
Join condition: None

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

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

(38) Exchange
Input [3]: [c_customer_sk#26, sum#30, isEmpty#31]
Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#32]

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

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

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

(42) BroadcastExchange
Input [1]: [c_customer_sk#26]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#37]

(43) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [cs_bill_customer_sk#2]
Right keys [1]: [c_customer_sk#26]
Join condition: None

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

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

(46) ColumnarToRow [codegen id : 8]
Input [3]: [d_date_sk#8, d_year#10, d_moy#38]

(47) Filter [codegen id : 8]
Input [3]: [d_date_sk#8, d_year#10, d_moy#38]
Condition : ((((isnotnull(d_year#10) AND isnotnull(d_moy#38)) AND (d_year#10 = 2000)) AND (d_moy#38 = 2)) AND isnotnull(d_date_sk#8))

(48) Project [codegen id : 8]
Output [1]: [d_date_sk#8]
Input [3]: [d_date_sk#8, d_year#10, d_moy#38]

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

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

(51) Project [codegen id : 9]
Output [1]: [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) AS sales#40]
Input [4]: [cs_sold_date_sk#1, cs_quantity#4, cs_list_price#5, d_date_sk#8]

(52) Scan parquet default.web_sales
Output [5]: [ws_sold_date_sk#41, ws_item_sk#42, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_sales]
PushedFilters: [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)>

(53) ColumnarToRow [codegen id : 18]
Input [5]: [ws_sold_date_sk#41, ws_item_sk#42, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45]

(54) Filter [codegen id : 18]
Input [5]: [ws_sold_date_sk#41, ws_item_sk#42, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45]
Condition : isnotnull(ws_sold_date_sk#41)

(55) ReusedExchange [Reuses operator id: 25]
Output [1]: [item_sk#20]

(56) BroadcastHashJoin [codegen id : 18]
Left keys [1]: [ws_item_sk#42]
Right keys [1]: [item_sk#20]
Join condition: None

(57) Project [codegen id : 18]
Output [4]: [ws_sold_date_sk#41, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45]
Input [5]: [ws_sold_date_sk#41, ws_item_sk#42, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45]

(58) ReusedExchange [Reuses operator id: 38]
Output [3]: [c_customer_sk#26, sum#46, isEmpty#47]

(59) HashAggregate [codegen id : 16]
Input [3]: [c_customer_sk#26, sum#46, isEmpty#47]
Keys [1]: [c_customer_sk#26]
Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#48]
Results [2]: [c_customer_sk#26, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#48 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#49]

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

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

(62) BroadcastExchange
Input [1]: [c_customer_sk#26]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#50]

(63) BroadcastHashJoin [codegen id : 18]
Left keys [1]: [ws_bill_customer_sk#43]
Right keys [1]: [c_customer_sk#26]
Join condition: None

(64) Project [codegen id : 18]
Output [3]: [ws_sold_date_sk#41, ws_quantity#44, ws_list_price#45]
Input [4]: [ws_sold_date_sk#41, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45]

(65) ReusedExchange [Reuses operator id: 49]
Output [1]: [d_date_sk#8]

(66) BroadcastHashJoin [codegen id : 18]
Left keys [1]: [ws_sold_date_sk#41]
Right keys [1]: [d_date_sk#8]
Join condition: None

(67) Project [codegen id : 18]
Output [1]: [CheckOverflow((promote_precision(cast(cast(ws_quantity#44 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#45 as decimal(12,2)))), DecimalType(18,2), true) AS sales#51]
Input [4]: [ws_sold_date_sk#41, ws_quantity#44, ws_list_price#45, d_date_sk#8]

(68) Union

(69) HashAggregate [codegen id : 19]
Input [1]: [sales#40]
Keys: []
Functions [1]: [partial_sum(sales#40)]
Aggregate Attributes [2]: [sum#52, isEmpty#53]
Results [2]: [sum#54, isEmpty#55]

(70) Exchange
Input [2]: [sum#54, isEmpty#55]
Arguments: SinglePartition, true, [id=#56]

(71) HashAggregate [codegen id : 20]
Input [2]: [sum#54, isEmpty#55]
Keys: []
Functions [1]: [sum(sales#40)]
Aggregate Attributes [1]: [sum(sales#40)#57]
Results [1]: [sum(sales#40)#57 AS sum(sales)#58]

===== Subqueries =====

Subquery:1 Hosting operator id = 40 Hosting Expression = Subquery scalar-subquery#35, [id=#36]
* HashAggregate (93)
+- Exchange (92)
   +- * HashAggregate (91)
      +- * HashAggregate (90)
         +- Exchange (89)
            +- * HashAggregate (88)
               +- * Project (87)
                  +- * BroadcastHashJoin Inner BuildRight (86)
                     :- * Project (80)
                     :  +- * BroadcastHashJoin Inner BuildRight (79)
                     :     :- * Filter (74)
                     :     :  +- * ColumnarToRow (73)
                     :     :     +- Scan parquet default.store_sales (72)
                     :     +- BroadcastExchange (78)
                     :        +- * Filter (77)
                     :           +- * ColumnarToRow (76)
                     :              +- Scan parquet default.customer (75)
                     +- BroadcastExchange (85)
                        +- * Project (84)
                           +- * Filter (83)
                              +- * ColumnarToRow (82)
                                 +- Scan parquet default.date_dim (81)


(72) Scan parquet default.store_sales
Output [4]: [ss_sold_date_sk#6, ss_customer_sk#23, ss_quantity#24, ss_sales_price#25]
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)>

(73) ColumnarToRow [codegen id : 3]
Input [4]: [ss_sold_date_sk#6, ss_customer_sk#23, ss_quantity#24, ss_sales_price#25]

(74) Filter [codegen id : 3]
Input [4]: [ss_sold_date_sk#6, ss_customer_sk#23, ss_quantity#24, ss_sales_price#25]
Condition : (isnotnull(ss_customer_sk#23) AND isnotnull(ss_sold_date_sk#6))

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

(76) ColumnarToRow [codegen id : 1]
Input [1]: [c_customer_sk#26]

(77) Filter [codegen id : 1]
Input [1]: [c_customer_sk#26]
Condition : isnotnull(c_customer_sk#26)

(78) BroadcastExchange
Input [1]: [c_customer_sk#26]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#59]

(79) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ss_customer_sk#23]
Right keys [1]: [c_customer_sk#26]
Join condition: None

(80) Project [codegen id : 3]
Output [4]: [ss_sold_date_sk#6, ss_quantity#24, ss_sales_price#25, c_customer_sk#26]
Input [5]: [ss_sold_date_sk#6, ss_customer_sk#23, ss_quantity#24, ss_sales_price#25, c_customer_sk#26]

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

(82) ColumnarToRow [codegen id : 2]
Input [2]: [d_date_sk#8, d_year#10]

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

(84) Project [codegen id : 2]
Output [1]: [d_date_sk#8]
Input [2]: [d_date_sk#8, d_year#10]

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

(86) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ss_sold_date_sk#6]
Right keys [1]: [d_date_sk#8]
Join condition: None

(87) Project [codegen id : 3]
Output [3]: [ss_quantity#24, ss_sales_price#25, c_customer_sk#26]
Input [5]: [ss_sold_date_sk#6, ss_quantity#24, ss_sales_price#25, c_customer_sk#26, d_date_sk#8]

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

(89) Exchange
Input [3]: [c_customer_sk#26, sum#63, isEmpty#64]
Arguments: hashpartitioning(c_customer_sk#26, 5), true, [id=#65]

(90) HashAggregate [codegen id : 4]
Input [3]: [c_customer_sk#26, sum#63, isEmpty#64]
Keys [1]: [c_customer_sk#26]
Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#66]
Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#24 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#25 as decimal(12,2)))), DecimalType(18,2), true))#66 AS csales#67]

(91) HashAggregate [codegen id : 4]
Input [1]: [csales#67]
Keys: []
Functions [1]: [partial_max(csales#67)]
Aggregate Attributes [1]: [max#68]
Results [1]: [max#69]

(92) Exchange
Input [1]: [max#69]
Arguments: SinglePartition, true, [id=#70]

(93) HashAggregate [codegen id : 5]
Input [1]: [max#69]
Keys: []
Functions [1]: [max(csales#67)]
Aggregate Attributes [1]: [max(csales#67)#71]
Results [1]: [max(csales#67)#71 AS tpcds_cmax#72]

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


