== Physical Plan ==
TakeOrderedAndProject (92)
+- Union (91)
   :- * HashAggregate (65)
   :  +- * CometColumnarToRow (64)
   :     +- CometColumnarExchange (63)
   :        +- * HashAggregate (62)
   :           +- * Project (61)
   :              +- * BroadcastHashJoin Inner BuildRight (60)
   :                 :- * Project (58)
   :                 :  +- * BroadcastHashJoin Inner BuildRight (57)
   :                 :     :- * SortMergeJoin LeftSemi (43)
   :                 :     :  :- * CometColumnarToRow (26)
   :                 :     :  :  +- CometSort (25)
   :                 :     :  :     +- CometExchange (24)
   :                 :     :  :        +- CometProject (23)
   :                 :     :  :           +- CometBroadcastHashJoin (22)
   :                 :     :  :              :- CometFilter (2)
   :                 :     :  :              :  +- CometScan parquet spark_catalog.default.catalog_sales (1)
   :                 :     :  :              +- CometBroadcastExchange (21)
   :                 :     :  :                 +- CometProject (20)
   :                 :     :  :                    +- CometFilter (19)
   :                 :     :  :                       +- CometHashAggregate (18)
   :                 :     :  :                          +- CometExchange (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 (42)
   :                 :     :     +- * Project (41)
   :                 :     :        +- * Filter (40)
   :                 :     :           +- * HashAggregate (39)
   :                 :     :              +- * CometColumnarToRow (38)
   :                 :     :                 +- CometColumnarExchange (37)
   :                 :     :                    +- * HashAggregate (36)
   :                 :     :                       +- * CometColumnarToRow (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 (56)
   :                 :        +- * SortMergeJoin LeftSemi (55)
   :                 :           :- * CometColumnarToRow (48)
   :                 :           :  +- CometSort (47)
   :                 :           :     +- CometExchange (46)
   :                 :           :        +- CometFilter (45)
   :                 :           :           +- CometScan parquet spark_catalog.default.customer (44)
   :                 :           +- * Sort (54)
   :                 :              +- * Project (53)
   :                 :                 +- * Filter (52)
   :                 :                    +- * HashAggregate (51)
   :                 :                       +- * CometColumnarToRow (50)
   :                 :                          +- ReusedExchange (49)
   :                 +- ReusedExchange (59)
   +- * HashAggregate (90)
      +- * CometColumnarToRow (89)
         +- CometColumnarExchange (88)
            +- * HashAggregate (87)
               +- * Project (86)
                  +- * BroadcastHashJoin Inner BuildRight (85)
                     :- * Project (83)
                     :  +- * BroadcastHashJoin Inner BuildRight (82)
                     :     :- * SortMergeJoin LeftSemi (80)
                     :     :  :- * CometColumnarToRow (73)
                     :     :  :  +- CometSort (72)
                     :     :  :     +- CometExchange (71)
                     :     :  :        +- CometProject (70)
                     :     :  :           +- CometBroadcastHashJoin (69)
                     :     :  :              :- CometFilter (67)
                     :     :  :              :  +- CometScan parquet spark_catalog.default.web_sales (66)
                     :     :  :              +- ReusedExchange (68)
                     :     :  +- * Sort (79)
                     :     :     +- * Project (78)
                     :     :        +- * Filter (77)
                     :     :           +- * HashAggregate (76)
                     :     :              +- * CometColumnarToRow (75)
                     :     :                 +- ReusedExchange (74)
                     :     +- ReusedExchange (81)
                     +- ReusedExchange (84)


(1) CometScan 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) CometScan 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) CometScan 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) CometScan 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) CometExchange
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, CometNativeShuffle, [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) CometExchange
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, CometNativeShuffle, [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) CometColumnarToRow [codegen id : 1]
Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]

(27) CometScan 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) CometScan 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) CometColumnarToRow [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) CometColumnarExchange
Input [3]: [c_customer_sk#23, sum#26, isEmpty#27]
Arguments: hashpartitioning(c_customer_sk#23, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=3]

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

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

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

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

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

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

(44) CometScan 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>

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

(46) CometExchange
Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34]
Arguments: hashpartitioning(c_customer_sk#32, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=4]

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

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

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

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

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

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

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

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

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

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

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

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

(59) ReusedExchange [Reuses operator id: 97]
Output [1]: [d_date_sk#35]

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

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

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

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

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

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

(66) CometScan 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)>

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

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

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

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

(71) CometExchange
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, CometNativeShuffle, [plan_id=7]

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

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

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

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

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

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

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

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

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

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

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

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

(84) ReusedExchange [Reuses operator id: 97]
Output [1]: [d_date_sk#58]

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

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

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

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

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

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

(91) Union

(92) 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 (97)
+- * CometColumnarToRow (96)
   +- CometProject (95)
      +- CometFilter (94)
         +- CometScan parquet spark_catalog.default.date_dim (93)


(93) CometScan 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>

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

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

(96) CometColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#35]

(97) 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 (102)
+- * CometColumnarToRow (101)
   +- CometProject (100)
      +- CometFilter (99)
         +- CometScan parquet spark_catalog.default.date_dim (98)


(98) CometScan 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>

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

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

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

(102) 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 = 40 Hosting Expression = Subquery scalar-subquery#30, [id=#31]
* HashAggregate (122)
+- * CometColumnarToRow (121)
   +- CometColumnarExchange (120)
      +- * HashAggregate (119)
         +- * HashAggregate (118)
            +- * CometColumnarToRow (117)
               +- CometColumnarExchange (116)
                  +- * HashAggregate (115)
                     +- * CometColumnarToRow (114)
                        +- CometProject (113)
                           +- CometBroadcastHashJoin (112)
                              :- CometProject (107)
                              :  +- CometBroadcastHashJoin (106)
                              :     :- CometFilter (104)
                              :     :  +- CometScan parquet spark_catalog.default.store_sales (103)
                              :     +- ReusedExchange (105)
                              +- CometBroadcastExchange (111)
                                 +- CometProject (110)
                                    +- CometFilter (109)
                                       +- CometScan parquet spark_catalog.default.date_dim (108)


(103) CometScan 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)>

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

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

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

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

(108) CometScan 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>

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

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

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

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

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

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

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

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

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

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

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

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

(121) CometColumnarToRow [codegen id : 3]
Input [1]: [max#82]

(122) 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 = 103 Hosting Expression = ss_sold_date_sk#70 IN dynamicpruning#71
BroadcastExchange (127)
+- * CometColumnarToRow (126)
   +- CometProject (125)
      +- CometFilter (124)
         +- CometScan parquet spark_catalog.default.date_dim (123)


(123) CometScan 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>

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

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

(126) CometColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#73]

(127) 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 = 52 Hosting Expression = ReusedSubquery Subquery scalar-subquery#30, [id=#31]

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

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


