== Physical Plan ==
TakeOrderedAndProject (87)
+- Union (86)
   :- * HashAggregate (62)
   :  +- Exchange (61)
   :     +- * HashAggregate (60)
   :        +- * Project (59)
   :           +- * BroadcastHashJoin Inner BuildRight (58)
   :              :- * Project (56)
   :              :  +- * BroadcastHashJoin Inner BuildRight (55)
   :              :     :- * SortMergeJoin LeftSemi (42)
   :              :     :  :- * ColumnarToRow (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 (41)
   :              :     :     +- * Project (40)
   :              :     :        +- * Filter (39)
   :              :     :           +- * HashAggregate (38)
   :              :     :              +- Exchange (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 (54)
   :              :        +- * SortMergeJoin LeftSemi (53)
   :              :           :- * ColumnarToRow (47)
   :              :           :  +- CometSort (46)
   :              :           :     +- CometExchange (45)
   :              :           :        +- CometFilter (44)
   :              :           :           +- CometScan parquet spark_catalog.default.customer (43)
   :              :           +- * Sort (52)
   :              :              +- * Project (51)
   :              :                 +- * Filter (50)
   :              :                    +- * HashAggregate (49)
   :              :                       +- ReusedExchange (48)
   :              +- ReusedExchange (57)
   +- * HashAggregate (85)
      +- Exchange (84)
         +- * HashAggregate (83)
            +- * Project (82)
               +- * BroadcastHashJoin Inner BuildRight (81)
                  :- * Project (79)
                  :  +- * BroadcastHashJoin Inner BuildRight (78)
                  :     :- * SortMergeJoin LeftSemi (76)
                  :     :  :- * ColumnarToRow (70)
                  :     :  :  +- CometSort (69)
                  :     :  :     +- CometExchange (68)
                  :     :  :        +- CometProject (67)
                  :     :  :           +- CometBroadcastHashJoin (66)
                  :     :  :              :- CometFilter (64)
                  :     :  :              :  +- CometScan parquet spark_catalog.default.web_sales (63)
                  :     :  :              +- ReusedExchange (65)
                  :     :  +- * Sort (75)
                  :     :     +- * Project (74)
                  :     :        +- * Filter (73)
                  :     :           +- * HashAggregate (72)
                  :     :              +- ReusedExchange (71)
                  :     +- ReusedExchange (77)
                  +- ReusedExchange (80)


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(57) ReusedExchange [Reuses operator id: 92]
Output [1]: [d_date_sk#35]

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

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

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

(61) Exchange
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, [plan_id=6]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(80) ReusedExchange [Reuses operator id: 92]
Output [1]: [d_date_sk#58]

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

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

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

(84) Exchange
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, [plan_id=8]

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

(86) Union

(87) 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 (92)
+- * ColumnarToRow (91)
   +- CometProject (90)
      +- CometFilter (89)
         +- CometScan parquet spark_catalog.default.date_dim (88)


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

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

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

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

(92) 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 (97)
+- * ColumnarToRow (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#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>

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

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

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

(97) 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 = 39 Hosting Expression = Subquery scalar-subquery#30, [id=#31]
* HashAggregate (115)
+- Exchange (114)
   +- * HashAggregate (113)
      +- * HashAggregate (112)
         +- Exchange (111)
            +- * HashAggregate (110)
               +- * ColumnarToRow (109)
                  +- CometProject (108)
                     +- CometBroadcastHashJoin (107)
                        :- CometProject (102)
                        :  +- CometBroadcastHashJoin (101)
                        :     :- CometFilter (99)
                        :     :  +- CometScan parquet spark_catalog.default.store_sales (98)
                        :     +- ReusedExchange (100)
                        +- CometBroadcastExchange (106)
                           +- CometProject (105)
                              +- CometFilter (104)
                                 +- CometScan parquet spark_catalog.default.date_dim (103)


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(114) Exchange
Input [1]: [max#82]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=12]

(115) 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 = 98 Hosting Expression = ss_sold_date_sk#70 IN dynamicpruning#71
BroadcastExchange (120)
+- * ColumnarToRow (119)
   +- CometProject (118)
      +- CometFilter (117)
         +- CometScan parquet spark_catalog.default.date_dim (116)


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

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

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

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

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

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

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


