== Physical Plan ==
TakeOrderedAndProject (93)
+- Union (92)
   :- * HashAggregate (66)
   :  +- * CometColumnarToRow (65)
   :     +- CometColumnarExchange (64)
   :        +- * HashAggregate (63)
   :           +- * Project (62)
   :              +- * BroadcastHashJoin Inner BuildRight (61)
   :                 :- * Project (59)
   :                 :  +- * BroadcastHashJoin Inner BuildRight (58)
   :                 :     :- * 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 (57)
   :                 :        +- * Project (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 (60)
   +- * HashAggregate (91)
      +- * CometColumnarToRow (90)
         +- CometColumnarExchange (89)
            +- * HashAggregate (88)
               +- * Project (87)
                  +- * BroadcastHashJoin Inner BuildRight (86)
                     :- * Project (84)
                     :  +- * BroadcastHashJoin Inner BuildRight (83)
                     :     :- * SortMergeJoin LeftSemi (81)
                     :     :  :- * CometColumnarToRow (74)
                     :     :  :  +- CometSort (73)
                     :     :  :     +- CometExchange (72)
                     :     :  :        +- CometProject (71)
                     :     :  :           +- CometBroadcastHashJoin (70)
                     :     :  :              :- CometFilter (68)
                     :     :  :              :  +- CometScan parquet spark_catalog.default.web_sales (67)
                     :     :  :              +- ReusedExchange (69)
                     :     :  +- * Sort (80)
                     :     :     +- * Project (79)
                     :     :        +- * Filter (78)
                     :     :           +- * HashAggregate (77)
                     :     :              +- * CometColumnarToRow (76)
                     :     :                 +- ReusedExchange (75)
                     :     +- ReusedExchange (82)
                     +- ReusedExchange (85)


(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) Project [codegen id : 7]
Output [3]: [c_customer_sk#32, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#33, 20, true, false, true) AS c_first_name#35, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#34, 30, true, false, true) AS c_last_name#36]
Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34]

(57) BroadcastExchange
Input [3]: [c_customer_sk#32, c_first_name#35, c_last_name#36]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] 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#35, c_last_name#36]
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#35, c_last_name#36]

(60) ReusedExchange [Reuses operator id: 98]
Output [1]: [d_date_sk#37]

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

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

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

(64) CometColumnarExchange
Input [4]: [c_last_name#36, c_first_name#35, sum#40, isEmpty#41]
Arguments: hashpartitioning(c_last_name#36, c_first_name#35, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=6]

(65) CometColumnarToRow [codegen id : 10]
Input [4]: [c_last_name#36, c_first_name#35, sum#40, isEmpty#41]

(66) HashAggregate [codegen id : 10]
Input [4]: [c_last_name#36, c_first_name#35, sum#40, isEmpty#41]
Keys [2]: [c_last_name#36, c_first_name#35]
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))#42]
Results [3]: [c_last_name#36, c_first_name#35, sum((cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4))#42 AS sales#43]

(67) CometScan parquet spark_catalog.default.web_sales
Output [5]: [ws_item_sk#44, ws_bill_customer_sk#45, ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#48), dynamicpruningexpression(ws_sold_date_sk#48 IN dynamicpruning#49)]
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)>

(68) CometFilter
Input [5]: [ws_item_sk#44, ws_bill_customer_sk#45, ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48]
Condition : isnotnull(ws_bill_customer_sk#45)

(69) ReusedExchange [Reuses operator id: 21]
Output [1]: [item_sk#50]

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

(71) CometProject
Input [5]: [ws_item_sk#44, ws_bill_customer_sk#45, ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48]
Arguments: [ws_bill_customer_sk#45, ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48], [ws_bill_customer_sk#45, ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48]

(72) CometExchange
Input [4]: [ws_bill_customer_sk#45, ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48]
Arguments: hashpartitioning(ws_bill_customer_sk#45, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=7]

(73) CometSort
Input [4]: [ws_bill_customer_sk#45, ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48]
Arguments: [ws_bill_customer_sk#45, ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48], [ws_bill_customer_sk#45 ASC NULLS FIRST]

(74) CometColumnarToRow [codegen id : 11]
Input [4]: [ws_bill_customer_sk#45, ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48]

(75) ReusedExchange [Reuses operator id: 37]
Output [3]: [c_customer_sk#51, sum#52, isEmpty#53]

(76) CometColumnarToRow [codegen id : 13]
Input [3]: [c_customer_sk#51, sum#52, isEmpty#53]

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

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

(79) Project [codegen id : 13]
Output [1]: [c_customer_sk#51]
Input [2]: [c_customer_sk#51, ssales#56]

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

(81) SortMergeJoin [codegen id : 19]
Left keys [1]: [ws_bill_customer_sk#45]
Right keys [1]: [c_customer_sk#51]
Join type: LeftSemi
Join condition: None

(82) ReusedExchange [Reuses operator id: 57]
Output [3]: [c_customer_sk#57, c_first_name#58, c_last_name#59]

(83) BroadcastHashJoin [codegen id : 19]
Left keys [1]: [ws_bill_customer_sk#45]
Right keys [1]: [c_customer_sk#57]
Join type: Inner
Join condition: None

(84) Project [codegen id : 19]
Output [5]: [ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48, c_first_name#58, c_last_name#59]
Input [7]: [ws_bill_customer_sk#45, ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48, c_customer_sk#57, c_first_name#58, c_last_name#59]

(85) ReusedExchange [Reuses operator id: 98]
Output [1]: [d_date_sk#60]

(86) BroadcastHashJoin [codegen id : 19]
Left keys [1]: [ws_sold_date_sk#48]
Right keys [1]: [d_date_sk#60]
Join type: Inner
Join condition: None

(87) Project [codegen id : 19]
Output [4]: [ws_quantity#46, ws_list_price#47, c_first_name#58, c_last_name#59]
Input [6]: [ws_quantity#46, ws_list_price#47, ws_sold_date_sk#48, c_first_name#58, c_last_name#59, d_date_sk#60]

(88) HashAggregate [codegen id : 19]
Input [4]: [ws_quantity#46, ws_list_price#47, c_first_name#58, c_last_name#59]
Keys [2]: [c_last_name#59, c_first_name#58]
Functions [1]: [partial_sum((cast(ws_quantity#46 as decimal(10,0)) * ws_list_price#47))]
Aggregate Attributes [2]: [sum#61, isEmpty#62]
Results [4]: [c_last_name#59, c_first_name#58, sum#63, isEmpty#64]

(89) CometColumnarExchange
Input [4]: [c_last_name#59, c_first_name#58, sum#63, isEmpty#64]
Arguments: hashpartitioning(c_last_name#59, c_first_name#58, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=8]

(90) CometColumnarToRow [codegen id : 20]
Input [4]: [c_last_name#59, c_first_name#58, sum#63, isEmpty#64]

(91) HashAggregate [codegen id : 20]
Input [4]: [c_last_name#59, c_first_name#58, sum#63, isEmpty#64]
Keys [2]: [c_last_name#59, c_first_name#58]
Functions [1]: [sum((cast(ws_quantity#46 as decimal(10,0)) * ws_list_price#47))]
Aggregate Attributes [1]: [sum((cast(ws_quantity#46 as decimal(10,0)) * ws_list_price#47))#65]
Results [3]: [c_last_name#59, c_first_name#58, sum((cast(ws_quantity#46 as decimal(10,0)) * ws_list_price#47))#65 AS sales#66]

(92) Union

(93) TakeOrderedAndProject
Input [3]: [c_last_name#36, c_first_name#35, sales#43]
Arguments: 100, [c_last_name#36 ASC NULLS FIRST, c_first_name#35 ASC NULLS FIRST, sales#43 ASC NULLS FIRST], [c_last_name#36, c_first_name#35, sales#43]

===== Subqueries =====

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


(94) CometScan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#37, d_year#67, d_moy#68]
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>

(95) CometFilter
Input [3]: [d_date_sk#37, d_year#67, d_moy#68]
Condition : ((((isnotnull(d_year#67) AND isnotnull(d_moy#68)) AND (d_year#67 = 2000)) AND (d_moy#68 = 2)) AND isnotnull(d_date_sk#37))

(96) CometProject
Input [3]: [d_date_sk#37, d_year#67, d_moy#68]
Arguments: [d_date_sk#37], [d_date_sk#37]

(97) CometColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#37]

(98) BroadcastExchange
Input [1]: [d_date_sk#37]
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 (103)
+- * CometColumnarToRow (102)
   +- CometProject (101)
      +- CometFilter (100)
         +- CometScan parquet spark_catalog.default.date_dim (99)


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

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

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

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

(103) 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 (123)
+- * CometColumnarToRow (122)
   +- CometColumnarExchange (121)
      +- * HashAggregate (120)
         +- * HashAggregate (119)
            +- * CometColumnarToRow (118)
               +- CometColumnarExchange (117)
                  +- * HashAggregate (116)
                     +- * CometColumnarToRow (115)
                        +- CometProject (114)
                           +- CometBroadcastHashJoin (113)
                              :- CometProject (108)
                              :  +- CometBroadcastHashJoin (107)
                              :     :- CometFilter (105)
                              :     :  +- CometScan parquet spark_catalog.default.store_sales (104)
                              :     +- ReusedExchange (106)
                              +- CometBroadcastExchange (112)
                                 +- CometProject (111)
                                    +- CometFilter (110)
                                       +- CometScan parquet spark_catalog.default.date_dim (109)


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

(105) CometFilter
Input [4]: [ss_customer_sk#69, ss_quantity#70, ss_sales_price#71, ss_sold_date_sk#72]
Condition : isnotnull(ss_customer_sk#69)

(106) ReusedExchange [Reuses operator id: 32]
Output [1]: [c_customer_sk#74]

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

(108) CometProject
Input [5]: [ss_customer_sk#69, ss_quantity#70, ss_sales_price#71, ss_sold_date_sk#72, c_customer_sk#74]
Arguments: [ss_quantity#70, ss_sales_price#71, ss_sold_date_sk#72, c_customer_sk#74], [ss_quantity#70, ss_sales_price#71, ss_sold_date_sk#72, c_customer_sk#74]

(109) CometScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#75, d_year#76]
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>

(110) CometFilter
Input [2]: [d_date_sk#75, d_year#76]
Condition : (d_year#76 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#75))

(111) CometProject
Input [2]: [d_date_sk#75, d_year#76]
Arguments: [d_date_sk#75], [d_date_sk#75]

(112) CometBroadcastExchange
Input [1]: [d_date_sk#75]
Arguments: [d_date_sk#75]

(113) CometBroadcastHashJoin
Left output [4]: [ss_quantity#70, ss_sales_price#71, ss_sold_date_sk#72, c_customer_sk#74]
Right output [1]: [d_date_sk#75]
Arguments: [ss_sold_date_sk#72], [d_date_sk#75], Inner, BuildRight

(114) CometProject
Input [5]: [ss_quantity#70, ss_sales_price#71, ss_sold_date_sk#72, c_customer_sk#74, d_date_sk#75]
Arguments: [ss_quantity#70, ss_sales_price#71, c_customer_sk#74], [ss_quantity#70, ss_sales_price#71, c_customer_sk#74]

(115) CometColumnarToRow [codegen id : 1]
Input [3]: [ss_quantity#70, ss_sales_price#71, c_customer_sk#74]

(116) HashAggregate [codegen id : 1]
Input [3]: [ss_quantity#70, ss_sales_price#71, c_customer_sk#74]
Keys [1]: [c_customer_sk#74]
Functions [1]: [partial_sum((cast(ss_quantity#70 as decimal(10,0)) * ss_sales_price#71))]
Aggregate Attributes [2]: [sum#77, isEmpty#78]
Results [3]: [c_customer_sk#74, sum#79, isEmpty#80]

(117) CometColumnarExchange
Input [3]: [c_customer_sk#74, sum#79, isEmpty#80]
Arguments: hashpartitioning(c_customer_sk#74, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=11]

(118) CometColumnarToRow [codegen id : 2]
Input [3]: [c_customer_sk#74, sum#79, isEmpty#80]

(119) HashAggregate [codegen id : 2]
Input [3]: [c_customer_sk#74, sum#79, isEmpty#80]
Keys [1]: [c_customer_sk#74]
Functions [1]: [sum((cast(ss_quantity#70 as decimal(10,0)) * ss_sales_price#71))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#70 as decimal(10,0)) * ss_sales_price#71))#81]
Results [1]: [sum((cast(ss_quantity#70 as decimal(10,0)) * ss_sales_price#71))#81 AS csales#82]

(120) HashAggregate [codegen id : 2]
Input [1]: [csales#82]
Keys: []
Functions [1]: [partial_max(csales#82)]
Aggregate Attributes [1]: [max#83]
Results [1]: [max#84]

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

(122) CometColumnarToRow [codegen id : 3]
Input [1]: [max#84]

(123) HashAggregate [codegen id : 3]
Input [1]: [max#84]
Keys: []
Functions [1]: [max(csales#82)]
Aggregate Attributes [1]: [max(csales#82)#85]
Results [1]: [max(csales#82)#85 AS tpcds_cmax#86]

Subquery:4 Hosting operator id = 104 Hosting Expression = ss_sold_date_sk#72 IN dynamicpruning#73
BroadcastExchange (128)
+- * CometColumnarToRow (127)
   +- CometProject (126)
      +- CometFilter (125)
         +- CometScan parquet spark_catalog.default.date_dim (124)


(124) CometScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#75, d_year#76]
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>

(125) CometFilter
Input [2]: [d_date_sk#75, d_year#76]
Condition : (d_year#76 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#75))

(126) CometProject
Input [2]: [d_date_sk#75, d_year#76]
Arguments: [d_date_sk#75], [d_date_sk#75]

(127) CometColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#75]

(128) BroadcastExchange
Input [1]: [d_date_sk#75]
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 = 67 Hosting Expression = ws_sold_date_sk#48 IN dynamicpruning#6

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


