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


(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)]
PushedFilters: [IsNotNull(cs_bill_customer_sk)]
ReadSchema: struct<cs_bill_customer_sk:int,cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2)>

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

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

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

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

(6) CometFilter
Input [3]: [d_date_sk#10, d_date#11, d_year#12]
Condition : (d_year#12 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#10))

(7) CometProject
Input [3]: [d_date_sk#10, d_date#11, d_year#12]
Arguments: [d_date_sk#10, d_date#11], [d_date_sk#10, d_date#11]

(8) CometBroadcastExchange
Input [2]: [d_date_sk#10, d_date#11]
Arguments: [d_date_sk#10, d_date#11]

(9) CometBroadcastHashJoin
Left output [2]: [ss_item_sk#7, ss_sold_date_sk#8]
Right output [2]: [d_date_sk#10, d_date#11]
Arguments: [ss_sold_date_sk#8], [d_date_sk#10], Inner, BuildRight

(10) CometProject
Input [4]: [ss_item_sk#7, ss_sold_date_sk#8, d_date_sk#10, d_date#11]
Arguments: [ss_item_sk#7, d_date#11], [ss_item_sk#7, d_date#11]

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

(12) CometFilter
Input [2]: [i_item_sk#13, i_item_desc#14]
Condition : isnotnull(i_item_sk#13)

(13) CometBroadcastExchange
Input [2]: [i_item_sk#13, i_item_desc#14]
Arguments: [i_item_sk#13, i_item_desc#14]

(14) CometBroadcastHashJoin
Left output [2]: [ss_item_sk#7, d_date#11]
Right output [2]: [i_item_sk#13, i_item_desc#14]
Arguments: [ss_item_sk#7], [i_item_sk#13], Inner, BuildRight

(15) CometProject
Input [4]: [ss_item_sk#7, d_date#11, i_item_sk#13, i_item_desc#14]
Arguments: [d_date#11, i_item_sk#13, _groupingexpression#15], [d_date#11, i_item_sk#13, substr(i_item_desc#14, 1, 30) AS _groupingexpression#15]

(16) CometHashAggregate
Input [3]: [d_date#11, i_item_sk#13, _groupingexpression#15]
Keys [3]: [_groupingexpression#15, i_item_sk#13, d_date#11]
Functions [1]: [partial_count(1)]

(17) CometColumnarExchange
Input [4]: [_groupingexpression#15, i_item_sk#13, d_date#11, count#16]
Arguments: hashpartitioning(_groupingexpression#15, i_item_sk#13, d_date#11, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=1]

(18) CometHashAggregate
Input [4]: [_groupingexpression#15, i_item_sk#13, d_date#11, count#16]
Keys [3]: [_groupingexpression#15, i_item_sk#13, d_date#11]
Functions [1]: [count(1)]

(19) CometFilter
Input [2]: [item_sk#17, cnt#18]
Condition : (cnt#18 > 4)

(20) CometProject
Input [2]: [item_sk#17, cnt#18]
Arguments: [item_sk#17], [item_sk#17]

(21) CometBroadcastExchange
Input [1]: [item_sk#17]
Arguments: [item_sk#17]

(22) CometBroadcastHashJoin
Left output [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
Right output [1]: [item_sk#17]
Arguments: [cs_item_sk#2], [item_sk#17], LeftSemi, BuildRight

(23) CometProject
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_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5], [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]

(24) CometColumnarExchange
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, CometColumnarShuffle, [plan_id=2]

(25) CometSort
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, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5], [cs_bill_customer_sk#1 ASC NULLS FIRST]

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

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

(28) CometFilter
Input [4]: [ss_customer_sk#19, ss_quantity#20, ss_sales_price#21, ss_sold_date_sk#22]
Condition : isnotnull(ss_customer_sk#19)

(29) CometProject
Input [4]: [ss_customer_sk#19, ss_quantity#20, ss_sales_price#21, ss_sold_date_sk#22]
Arguments: [ss_customer_sk#19, ss_quantity#20, ss_sales_price#21], [ss_customer_sk#19, ss_quantity#20, ss_sales_price#21]

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

(31) CometFilter
Input [1]: [c_customer_sk#23]
Condition : isnotnull(c_customer_sk#23)

(32) CometBroadcastExchange
Input [1]: [c_customer_sk#23]
Arguments: [c_customer_sk#23]

(33) CometBroadcastHashJoin
Left output [3]: [ss_customer_sk#19, ss_quantity#20, ss_sales_price#21]
Right output [1]: [c_customer_sk#23]
Arguments: [ss_customer_sk#19], [c_customer_sk#23], Inner, BuildRight

(34) CometProject
Input [4]: [ss_customer_sk#19, ss_quantity#20, ss_sales_price#21, c_customer_sk#23]
Arguments: [ss_quantity#20, ss_sales_price#21, c_customer_sk#23], [ss_quantity#20, ss_sales_price#21, c_customer_sk#23]

(35) ColumnarToRow [codegen id : 2]
Input [3]: [ss_quantity#20, ss_sales_price#21, c_customer_sk#23]

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

(37) RowToColumnar
Input [3]: [c_customer_sk#23, sum#26, isEmpty#27]

(38) CometColumnarExchange
Input [3]: [c_customer_sk#23, sum#26, isEmpty#27]
Arguments: hashpartitioning(c_customer_sk#23, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=3]

(39) ColumnarToRow [codegen id : 3]
Input [3]: [c_customer_sk#23, sum#26, isEmpty#27]

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

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

(42) Project [codegen id : 3]
Output [1]: [c_customer_sk#23]
Input [2]: [c_customer_sk#23, ssales#29]

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

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

(45) Scan parquet spark_catalog.default.customer
Output [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34]
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>

(46) CometFilter
Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34]
Condition : isnotnull(c_customer_sk#32)

(47) CometColumnarExchange
Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34]
Arguments: hashpartitioning(c_customer_sk#32, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=4]

(48) CometSort
Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34]
Arguments: [c_customer_sk#32, c_first_name#33, c_last_name#34], [c_customer_sk#32 ASC NULLS FIRST]

(49) ColumnarToRow [codegen id : 4]
Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34]

(50) ReusedExchange [Reuses operator id: 38]
Output [3]: [c_customer_sk#23, sum#26, isEmpty#27]

(51) ColumnarToRow [codegen id : 6]
Input [3]: [c_customer_sk#23, sum#26, isEmpty#27]

(52) HashAggregate [codegen id : 6]
Input [3]: [c_customer_sk#23, sum#26, isEmpty#27]
Keys [1]: [c_customer_sk#23]
Functions [1]: [sum((cast(ss_quantity#20 as decimal(10,0)) * ss_sales_price#21))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#20 as decimal(10,0)) * ss_sales_price#21))#28]
Results [2]: [c_customer_sk#23, sum((cast(ss_quantity#20 as decimal(10,0)) * ss_sales_price#21))#28 AS ssales#29]

(53) Filter [codegen id : 6]
Input [2]: [c_customer_sk#23, ssales#29]
Condition : (isnotnull(ssales#29) AND (cast(ssales#29 as decimal(38,8)) > (0.500000 * ReusedSubquery Subquery scalar-subquery#30, [id=#31])))

(54) Project [codegen id : 6]
Output [1]: [c_customer_sk#23]
Input [2]: [c_customer_sk#23, ssales#29]

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

(56) SortMergeJoin [codegen id : 7]
Left keys [1]: [c_customer_sk#32]
Right keys [1]: [c_customer_sk#23]
Join type: LeftSemi
Join condition: None

(57) BroadcastExchange
Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=5]

(58) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#32]
Join type: Inner
Join condition: None

(59) Project [codegen id : 9]
Output [5]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, c_first_name#33, c_last_name#34]
Input [7]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, c_customer_sk#32, c_first_name#33, c_last_name#34]

(60) ReusedExchange [Reuses operator id: 100]
Output [1]: [d_date_sk#35]

(61) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [cs_sold_date_sk#5]
Right keys [1]: [d_date_sk#35]
Join type: Inner
Join condition: None

(62) Project [codegen id : 9]
Output [4]: [cs_quantity#3, cs_list_price#4, c_first_name#33, c_last_name#34]
Input [6]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, c_first_name#33, c_last_name#34, d_date_sk#35]

(63) HashAggregate [codegen id : 9]
Input [4]: [cs_quantity#3, cs_list_price#4, c_first_name#33, c_last_name#34]
Keys [2]: [c_last_name#34, c_first_name#33]
Functions [1]: [partial_sum((cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4))]
Aggregate Attributes [2]: [sum#36, isEmpty#37]
Results [4]: [c_last_name#34, c_first_name#33, sum#38, isEmpty#39]

(64) RowToColumnar
Input [4]: [c_last_name#34, c_first_name#33, sum#38, isEmpty#39]

(65) CometColumnarExchange
Input [4]: [c_last_name#34, c_first_name#33, sum#38, isEmpty#39]
Arguments: hashpartitioning(c_last_name#34, c_first_name#33, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=6]

(66) ColumnarToRow [codegen id : 10]
Input [4]: [c_last_name#34, c_first_name#33, sum#38, isEmpty#39]

(67) HashAggregate [codegen id : 10]
Input [4]: [c_last_name#34, c_first_name#33, sum#38, isEmpty#39]
Keys [2]: [c_last_name#34, c_first_name#33]
Functions [1]: [sum((cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4))]
Aggregate Attributes [1]: [sum((cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4))#40]
Results [3]: [c_last_name#34, c_first_name#33, sum((cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4))#40 AS sales#41]

(68) Scan parquet spark_catalog.default.web_sales
Output [5]: [ws_item_sk#42, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#46), dynamicpruningexpression(ws_sold_date_sk#46 IN dynamicpruning#47)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_item_sk:int,ws_bill_customer_sk:int,ws_quantity:int,ws_list_price:decimal(7,2)>

(69) CometFilter
Input [5]: [ws_item_sk#42, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46]
Condition : isnotnull(ws_bill_customer_sk#43)

(70) ReusedExchange [Reuses operator id: 21]
Output [1]: [item_sk#48]

(71) CometBroadcastHashJoin
Left output [5]: [ws_item_sk#42, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46]
Right output [1]: [item_sk#48]
Arguments: [ws_item_sk#42], [item_sk#48], LeftSemi, BuildRight

(72) CometProject
Input [5]: [ws_item_sk#42, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46]
Arguments: [ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46], [ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46]

(73) CometColumnarExchange
Input [4]: [ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46]
Arguments: hashpartitioning(ws_bill_customer_sk#43, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=7]

(74) CometSort
Input [4]: [ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46]
Arguments: [ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46], [ws_bill_customer_sk#43 ASC NULLS FIRST]

(75) ColumnarToRow [codegen id : 11]
Input [4]: [ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46]

(76) ReusedExchange [Reuses operator id: 38]
Output [3]: [c_customer_sk#49, sum#50, isEmpty#51]

(77) ColumnarToRow [codegen id : 13]
Input [3]: [c_customer_sk#49, sum#50, isEmpty#51]

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

(79) Filter [codegen id : 13]
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#30, [id=#31])))

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

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

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

(83) ReusedExchange [Reuses operator id: 57]
Output [3]: [c_customer_sk#55, c_first_name#56, c_last_name#57]

(84) BroadcastHashJoin [codegen id : 19]
Left keys [1]: [ws_bill_customer_sk#43]
Right keys [1]: [c_customer_sk#55]
Join type: Inner
Join condition: None

(85) Project [codegen id : 19]
Output [5]: [ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46, c_first_name#56, c_last_name#57]
Input [7]: [ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46, c_customer_sk#55, c_first_name#56, c_last_name#57]

(86) ReusedExchange [Reuses operator id: 100]
Output [1]: [d_date_sk#58]

(87) BroadcastHashJoin [codegen id : 19]
Left keys [1]: [ws_sold_date_sk#46]
Right keys [1]: [d_date_sk#58]
Join type: Inner
Join condition: None

(88) Project [codegen id : 19]
Output [4]: [ws_quantity#44, ws_list_price#45, c_first_name#56, c_last_name#57]
Input [6]: [ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46, c_first_name#56, c_last_name#57, d_date_sk#58]

(89) HashAggregate [codegen id : 19]
Input [4]: [ws_quantity#44, ws_list_price#45, c_first_name#56, c_last_name#57]
Keys [2]: [c_last_name#57, c_first_name#56]
Functions [1]: [partial_sum((cast(ws_quantity#44 as decimal(10,0)) * ws_list_price#45))]
Aggregate Attributes [2]: [sum#59, isEmpty#60]
Results [4]: [c_last_name#57, c_first_name#56, sum#61, isEmpty#62]

(90) RowToColumnar
Input [4]: [c_last_name#57, c_first_name#56, sum#61, isEmpty#62]

(91) CometColumnarExchange
Input [4]: [c_last_name#57, c_first_name#56, sum#61, isEmpty#62]
Arguments: hashpartitioning(c_last_name#57, c_first_name#56, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=8]

(92) ColumnarToRow [codegen id : 20]
Input [4]: [c_last_name#57, c_first_name#56, sum#61, isEmpty#62]

(93) HashAggregate [codegen id : 20]
Input [4]: [c_last_name#57, c_first_name#56, sum#61, isEmpty#62]
Keys [2]: [c_last_name#57, c_first_name#56]
Functions [1]: [sum((cast(ws_quantity#44 as decimal(10,0)) * ws_list_price#45))]
Aggregate Attributes [1]: [sum((cast(ws_quantity#44 as decimal(10,0)) * ws_list_price#45))#63]
Results [3]: [c_last_name#57, c_first_name#56, sum((cast(ws_quantity#44 as decimal(10,0)) * ws_list_price#45))#63 AS sales#64]

(94) Union

(95) TakeOrderedAndProject
Input [3]: [c_last_name#34, c_first_name#33, sales#41]
Arguments: 100, [c_last_name#34 ASC NULLS FIRST, c_first_name#33 ASC NULLS FIRST, sales#41 ASC NULLS FIRST], [c_last_name#34, c_first_name#33, sales#41]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6
BroadcastExchange (100)
+- * ColumnarToRow (99)
   +- CometProject (98)
      +- CometFilter (97)
         +- CometScan parquet spark_catalog.default.date_dim (96)


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

(97) CometFilter
Input [3]: [d_date_sk#35, d_year#65, d_moy#66]
Condition : ((((isnotnull(d_year#65) AND isnotnull(d_moy#66)) AND (d_year#65 = 2000)) AND (d_moy#66 = 2)) AND isnotnull(d_date_sk#35))

(98) CometProject
Input [3]: [d_date_sk#35, d_year#65, d_moy#66]
Arguments: [d_date_sk#35], [d_date_sk#35]

(99) ColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#35]

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

Subquery:2 Hosting operator id = 3 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9
BroadcastExchange (105)
+- * ColumnarToRow (104)
   +- CometProject (103)
      +- CometFilter (102)
         +- CometScan parquet spark_catalog.default.date_dim (101)


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

(102) CometFilter
Input [3]: [d_date_sk#10, d_date#11, d_year#12]
Condition : (d_year#12 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#10))

(103) CometProject
Input [3]: [d_date_sk#10, d_date#11, d_year#12]
Arguments: [d_date_sk#10, d_date#11], [d_date_sk#10, d_date#11]

(104) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#10, d_date#11]

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

Subquery:3 Hosting operator id = 41 Hosting Expression = Subquery scalar-subquery#30, [id=#31]
* HashAggregate (127)
+- * ColumnarToRow (126)
   +- CometColumnarExchange (125)
      +- RowToColumnar (124)
         +- * HashAggregate (123)
            +- * HashAggregate (122)
               +- * ColumnarToRow (121)
                  +- CometColumnarExchange (120)
                     +- RowToColumnar (119)
                        +- * HashAggregate (118)
                           +- * ColumnarToRow (117)
                              +- CometProject (116)
                                 +- CometBroadcastHashJoin (115)
                                    :- CometProject (110)
                                    :  +- CometBroadcastHashJoin (109)
                                    :     :- CometFilter (107)
                                    :     :  +- CometScan parquet spark_catalog.default.store_sales (106)
                                    :     +- ReusedExchange (108)
                                    +- CometBroadcastExchange (114)
                                       +- CometProject (113)
                                          +- CometFilter (112)
                                             +- CometScan parquet spark_catalog.default.date_dim (111)


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

(107) CometFilter
Input [4]: [ss_customer_sk#67, ss_quantity#68, ss_sales_price#69, ss_sold_date_sk#70]
Condition : isnotnull(ss_customer_sk#67)

(108) ReusedExchange [Reuses operator id: 32]
Output [1]: [c_customer_sk#72]

(109) CometBroadcastHashJoin
Left output [4]: [ss_customer_sk#67, ss_quantity#68, ss_sales_price#69, ss_sold_date_sk#70]
Right output [1]: [c_customer_sk#72]
Arguments: [ss_customer_sk#67], [c_customer_sk#72], Inner, BuildRight

(110) CometProject
Input [5]: [ss_customer_sk#67, ss_quantity#68, ss_sales_price#69, ss_sold_date_sk#70, c_customer_sk#72]
Arguments: [ss_quantity#68, ss_sales_price#69, ss_sold_date_sk#70, c_customer_sk#72], [ss_quantity#68, ss_sales_price#69, ss_sold_date_sk#70, c_customer_sk#72]

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

(112) CometFilter
Input [2]: [d_date_sk#73, d_year#74]
Condition : (d_year#74 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#73))

(113) CometProject
Input [2]: [d_date_sk#73, d_year#74]
Arguments: [d_date_sk#73], [d_date_sk#73]

(114) CometBroadcastExchange
Input [1]: [d_date_sk#73]
Arguments: [d_date_sk#73]

(115) CometBroadcastHashJoin
Left output [4]: [ss_quantity#68, ss_sales_price#69, ss_sold_date_sk#70, c_customer_sk#72]
Right output [1]: [d_date_sk#73]
Arguments: [ss_sold_date_sk#70], [d_date_sk#73], Inner, BuildRight

(116) CometProject
Input [5]: [ss_quantity#68, ss_sales_price#69, ss_sold_date_sk#70, c_customer_sk#72, d_date_sk#73]
Arguments: [ss_quantity#68, ss_sales_price#69, c_customer_sk#72], [ss_quantity#68, ss_sales_price#69, c_customer_sk#72]

(117) ColumnarToRow [codegen id : 1]
Input [3]: [ss_quantity#68, ss_sales_price#69, c_customer_sk#72]

(118) HashAggregate [codegen id : 1]
Input [3]: [ss_quantity#68, ss_sales_price#69, c_customer_sk#72]
Keys [1]: [c_customer_sk#72]
Functions [1]: [partial_sum((cast(ss_quantity#68 as decimal(10,0)) * ss_sales_price#69))]
Aggregate Attributes [2]: [sum#75, isEmpty#76]
Results [3]: [c_customer_sk#72, sum#77, isEmpty#78]

(119) RowToColumnar
Input [3]: [c_customer_sk#72, sum#77, isEmpty#78]

(120) CometColumnarExchange
Input [3]: [c_customer_sk#72, sum#77, isEmpty#78]
Arguments: hashpartitioning(c_customer_sk#72, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=11]

(121) ColumnarToRow [codegen id : 2]
Input [3]: [c_customer_sk#72, sum#77, isEmpty#78]

(122) HashAggregate [codegen id : 2]
Input [3]: [c_customer_sk#72, sum#77, isEmpty#78]
Keys [1]: [c_customer_sk#72]
Functions [1]: [sum((cast(ss_quantity#68 as decimal(10,0)) * ss_sales_price#69))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#68 as decimal(10,0)) * ss_sales_price#69))#79]
Results [1]: [sum((cast(ss_quantity#68 as decimal(10,0)) * ss_sales_price#69))#79 AS csales#80]

(123) HashAggregate [codegen id : 2]
Input [1]: [csales#80]
Keys: []
Functions [1]: [partial_max(csales#80)]
Aggregate Attributes [1]: [max#81]
Results [1]: [max#82]

(124) RowToColumnar
Input [1]: [max#82]

(125) CometColumnarExchange
Input [1]: [max#82]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=12]

(126) ColumnarToRow [codegen id : 3]
Input [1]: [max#82]

(127) HashAggregate [codegen id : 3]
Input [1]: [max#82]
Keys: []
Functions [1]: [max(csales#80)]
Aggregate Attributes [1]: [max(csales#80)#83]
Results [1]: [max(csales#80)#83 AS tpcds_cmax#84]

Subquery:4 Hosting operator id = 106 Hosting Expression = ss_sold_date_sk#70 IN dynamicpruning#71
BroadcastExchange (132)
+- * ColumnarToRow (131)
   +- CometProject (130)
      +- CometFilter (129)
         +- CometScan parquet spark_catalog.default.date_dim (128)


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

(129) CometFilter
Input [2]: [d_date_sk#73, d_year#74]
Condition : (d_year#74 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#73))

(130) CometProject
Input [2]: [d_date_sk#73, d_year#74]
Arguments: [d_date_sk#73], [d_date_sk#73]

(131) ColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#73]

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

Subquery:5 Hosting operator id = 53 Hosting Expression = ReusedSubquery Subquery scalar-subquery#30, [id=#31]

Subquery:6 Hosting operator id = 68 Hosting Expression = ws_sold_date_sk#46 IN dynamicpruning#6

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


