== Physical Plan ==
TakeOrderedAndProject (91)
+- Union (90)
   :- * HashAggregate (66)
   :  +- Exchange (65)
   :     +- * HashAggregate (64)
   :        +- * Project (63)
   :           +- * BroadcastHashJoin Inner BuildRight (62)
   :              :- * Project (56)
   :              :  +- * BroadcastHashJoin Inner BuildRight (55)
   :              :     :- * SortMergeJoin LeftSemi (42)
   :              :     :  :- * ColumnarToRow (26)
   :              :     :  :  +- CometSort (25)
   :              :     :  :     +- CometExchange (24)
   :              :     :  :        +- CometProject (23)
   :              :     :  :           +- CometBroadcastHashJoin (22)
   :              :     :  :              :- CometFilter (2)
   :              :     :  :              :  +- CometNativeScan: `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)
   :              :     :  :                                      :     :  +- CometNativeScan: `spark_catalog`.`default`.`store_sales` (3)
   :              :     :  :                                      :     +- CometBroadcastExchange (8)
   :              :     :  :                                      :        +- CometProject (7)
   :              :     :  :                                      :           +- CometFilter (6)
   :              :     :  :                                      :              +- CometNativeScan: `spark_catalog`.`default`.`date_dim` (5)
   :              :     :  :                                      +- CometBroadcastExchange (13)
   :              :     :  :                                         +- CometFilter (12)
   :              :     :  :                                            +- CometNativeScan: `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)
   :              :     :                             :     +- CometNativeScan: `spark_catalog`.`default`.`store_sales` (27)
   :              :     :                             +- CometBroadcastExchange (32)
   :              :     :                                +- CometFilter (31)
   :              :     :                                   +- CometNativeScan: `spark_catalog`.`default`.`customer` (30)
   :              :     +- BroadcastExchange (54)
   :              :        +- * SortMergeJoin LeftSemi (53)
   :              :           :- * ColumnarToRow (47)
   :              :           :  +- CometSort (46)
   :              :           :     +- CometExchange (45)
   :              :           :        +- CometFilter (44)
   :              :           :           +- CometNativeScan: `spark_catalog`.`default`.`customer` (43)
   :              :           +- * Sort (52)
   :              :              +- * Project (51)
   :              :                 +- * Filter (50)
   :              :                    +- * HashAggregate (49)
   :              :                       +- ReusedExchange (48)
   :              +- BroadcastExchange (61)
   :                 +- * ColumnarToRow (60)
   :                    +- CometProject (59)
   :                       +- CometFilter (58)
   :                          +- CometNativeScan: `spark_catalog`.`default`.`date_dim` (57)
   +- * HashAggregate (89)
      +- Exchange (88)
         +- * HashAggregate (87)
            +- * Project (86)
               +- * BroadcastHashJoin Inner BuildRight (85)
                  :- * Project (83)
                  :  +- * BroadcastHashJoin Inner BuildRight (82)
                  :     :- * SortMergeJoin LeftSemi (80)
                  :     :  :- * ColumnarToRow (74)
                  :     :  :  +- CometSort (73)
                  :     :  :     +- CometExchange (72)
                  :     :  :        +- CometProject (71)
                  :     :  :           +- CometBroadcastHashJoin (70)
                  :     :  :              :- CometFilter (68)
                  :     :  :              :  +- CometNativeScan: `spark_catalog`.`default`.`web_sales` (67)
                  :     :  :              +- ReusedExchange (69)
                  :     :  +- * Sort (79)
                  :     :     +- * Project (78)
                  :     :        +- * Filter (77)
                  :     :           +- * HashAggregate (76)
                  :     :              +- ReusedExchange (75)
                  :     +- ReusedExchange (81)
                  +- ReusedExchange (84)


(1) CometNativeScan: `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]
Arguments: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]

(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) CometNativeScan: `spark_catalog`.`default`.`store_sales`
Output [2]: [ss_item_sk#6, ss_sold_date_sk#7]
Arguments: [ss_item_sk#6, ss_sold_date_sk#7]

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

(5) CometNativeScan: `spark_catalog`.`default`.`date_dim`
Output [3]: [d_date_sk#8, d_date#9, d_year#10]
Arguments: [d_date_sk#8, d_date#9, d_year#10]

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

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

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

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

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

(11) CometNativeScan: `spark_catalog`.`default`.`item`
Output [2]: [i_item_sk#11, i_item_desc#12]
Arguments: [i_item_sk#11, i_item_desc#12]

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

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

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

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

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

(17) CometExchange
Input [4]: [_groupingexpression#13, i_item_sk#11, d_date#9, count#14]
Arguments: hashpartitioning(_groupingexpression#13, i_item_sk#11, d_date#9, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]

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

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

(20) CometProject
Input [2]: [item_sk#15, cnt#16]
Arguments: [item_sk#15], [item_sk#15]

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

(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#15]
Arguments: [cs_item_sk#2], [item_sk#15], 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) CometNativeScan: `spark_catalog`.`default`.`store_sales`
Output [4]: [ss_customer_sk#17, ss_quantity#18, ss_sales_price#19, ss_sold_date_sk#20]
Arguments: [ss_customer_sk#17, ss_quantity#18, ss_sales_price#19, ss_sold_date_sk#20]

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

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

(30) CometNativeScan: `spark_catalog`.`default`.`customer`
Output [1]: [c_customer_sk#21]
Arguments: [c_customer_sk#21]

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

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

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

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

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

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

(37) Exchange
Input [3]: [c_customer_sk#21, sum#24, isEmpty#25]
Arguments: hashpartitioning(c_customer_sk#21, 5), ENSURE_REQUIREMENTS, [plan_id=3]

(38) HashAggregate [codegen id : 3]
Input [3]: [c_customer_sk#21, sum#24, isEmpty#25]
Keys [1]: [c_customer_sk#21]
Functions [1]: [sum((cast(ss_quantity#18 as decimal(10,0)) * ss_sales_price#19))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#18 as decimal(10,0)) * ss_sales_price#19))#26]
Results [2]: [c_customer_sk#21, sum((cast(ss_quantity#18 as decimal(10,0)) * ss_sales_price#19))#26 AS ssales#27]

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

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

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

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

(43) CometNativeScan: `spark_catalog`.`default`.`customer`
Output [3]: [c_customer_sk#30, c_first_name#31, c_last_name#32]
Arguments: [c_customer_sk#30, c_first_name#31, c_last_name#32]

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

(45) CometExchange
Input [3]: [c_customer_sk#30, c_first_name#31, c_last_name#32]
Arguments: hashpartitioning(c_customer_sk#30, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=4]

(46) CometSort
Input [3]: [c_customer_sk#30, c_first_name#31, c_last_name#32]
Arguments: [c_customer_sk#30, c_first_name#31, c_last_name#32], [c_customer_sk#30 ASC NULLS FIRST]

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

(48) ReusedExchange [Reuses operator id: 37]
Output [3]: [c_customer_sk#21, sum#24, isEmpty#25]

(49) HashAggregate [codegen id : 6]
Input [3]: [c_customer_sk#21, sum#24, isEmpty#25]
Keys [1]: [c_customer_sk#21]
Functions [1]: [sum((cast(ss_quantity#18 as decimal(10,0)) * ss_sales_price#19))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#18 as decimal(10,0)) * ss_sales_price#19))#26]
Results [2]: [c_customer_sk#21, sum((cast(ss_quantity#18 as decimal(10,0)) * ss_sales_price#19))#26 AS ssales#27]

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

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

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

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

(54) BroadcastExchange
Input [3]: [c_customer_sk#30, c_first_name#31, c_last_name#32]
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#30]
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#31, c_last_name#32]
Input [7]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, c_customer_sk#30, c_first_name#31, c_last_name#32]

(57) CometNativeScan: `spark_catalog`.`default`.`date_dim`
Output [3]: [d_date_sk#33, d_year#34, d_moy#35]
Arguments: [d_date_sk#33, d_year#34, d_moy#35]

(58) CometFilter
Input [3]: [d_date_sk#33, d_year#34, d_moy#35]
Condition : ((((isnotnull(d_year#34) AND isnotnull(d_moy#35)) AND (d_year#34 = 2000)) AND (d_moy#35 = 2)) AND isnotnull(d_date_sk#33))

(59) CometProject
Input [3]: [d_date_sk#33, d_year#34, d_moy#35]
Arguments: [d_date_sk#33], [d_date_sk#33]

(60) ColumnarToRow [codegen id : 8]
Input [1]: [d_date_sk#33]

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

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

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

(64) HashAggregate [codegen id : 9]
Input [4]: [cs_quantity#3, cs_list_price#4, c_first_name#31, c_last_name#32]
Keys [2]: [c_last_name#32, c_first_name#31]
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#32, c_first_name#31, sum#38, isEmpty#39]

(65) Exchange
Input [4]: [c_last_name#32, c_first_name#31, sum#38, isEmpty#39]
Arguments: hashpartitioning(c_last_name#32, c_first_name#31, 5), ENSURE_REQUIREMENTS, [plan_id=7]

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

(67) CometNativeScan: `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]
Arguments: [ws_item_sk#42, ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46]

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

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

(70) 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#47]
Arguments: [ws_item_sk#42], [item_sk#47], LeftSemi, BuildRight

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

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

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

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

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

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

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

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

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

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

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

(82) BroadcastHashJoin [codegen id : 19]
Left keys [1]: [ws_bill_customer_sk#43]
Right keys [1]: [c_customer_sk#54]
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#55, c_last_name#56]
Input [7]: [ws_bill_customer_sk#43, ws_quantity#44, ws_list_price#45, ws_sold_date_sk#46, c_customer_sk#54, c_first_name#55, c_last_name#56]

(84) ReusedExchange [Reuses operator id: 61]
Output [1]: [d_date_sk#57]

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

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

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

(88) Exchange
Input [4]: [c_last_name#56, c_first_name#55, sum#60, isEmpty#61]
Arguments: hashpartitioning(c_last_name#56, c_first_name#55, 5), ENSURE_REQUIREMENTS, [plan_id=9]

(89) HashAggregate [codegen id : 20]
Input [4]: [c_last_name#56, c_first_name#55, sum#60, isEmpty#61]
Keys [2]: [c_last_name#56, c_first_name#55]
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))#62]
Results [3]: [c_last_name#56, c_first_name#55, sum((cast(ws_quantity#44 as decimal(10,0)) * ws_list_price#45))#62 AS sales#63]

(90) Union

(91) TakeOrderedAndProject
Input [3]: [c_last_name#32, c_first_name#31, sales#41]
Arguments: 100, [c_last_name#32 ASC NULLS FIRST, c_first_name#31 ASC NULLS FIRST, sales#41 ASC NULLS FIRST], [c_last_name#32, c_first_name#31, sales#41]

===== Subqueries =====

Subquery:1 Hosting operator id = 39 Hosting Expression = Subquery scalar-subquery#28, [id=#29]
* HashAggregate (109)
+- Exchange (108)
   +- * HashAggregate (107)
      +- * HashAggregate (106)
         +- Exchange (105)
            +- * HashAggregate (104)
               +- * ColumnarToRow (103)
                  +- CometProject (102)
                     +- CometBroadcastHashJoin (101)
                        :- CometProject (96)
                        :  +- CometBroadcastHashJoin (95)
                        :     :- CometFilter (93)
                        :     :  +- CometNativeScan: `spark_catalog`.`default`.`store_sales` (92)
                        :     +- ReusedExchange (94)
                        +- CometBroadcastExchange (100)
                           +- CometProject (99)
                              +- CometFilter (98)
                                 +- CometNativeScan: `spark_catalog`.`default`.`date_dim` (97)


(92) CometNativeScan: `spark_catalog`.`default`.`store_sales`
Output [4]: [ss_customer_sk#64, ss_quantity#65, ss_sales_price#66, ss_sold_date_sk#67]
Arguments: [ss_customer_sk#64, ss_quantity#65, ss_sales_price#66, ss_sold_date_sk#67]

(93) CometFilter
Input [4]: [ss_customer_sk#64, ss_quantity#65, ss_sales_price#66, ss_sold_date_sk#67]
Condition : isnotnull(ss_customer_sk#64)

(94) ReusedExchange [Reuses operator id: 32]
Output [1]: [c_customer_sk#68]

(95) CometBroadcastHashJoin
Left output [4]: [ss_customer_sk#64, ss_quantity#65, ss_sales_price#66, ss_sold_date_sk#67]
Right output [1]: [c_customer_sk#68]
Arguments: [ss_customer_sk#64], [c_customer_sk#68], Inner, BuildRight

(96) CometProject
Input [5]: [ss_customer_sk#64, ss_quantity#65, ss_sales_price#66, ss_sold_date_sk#67, c_customer_sk#68]
Arguments: [ss_quantity#65, ss_sales_price#66, ss_sold_date_sk#67, c_customer_sk#68], [ss_quantity#65, ss_sales_price#66, ss_sold_date_sk#67, c_customer_sk#68]

(97) CometNativeScan: `spark_catalog`.`default`.`date_dim`
Output [2]: [d_date_sk#69, d_year#70]
Arguments: [d_date_sk#69, d_year#70]

(98) CometFilter
Input [2]: [d_date_sk#69, d_year#70]
Condition : (d_year#70 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#69))

(99) CometProject
Input [2]: [d_date_sk#69, d_year#70]
Arguments: [d_date_sk#69], [d_date_sk#69]

(100) CometBroadcastExchange
Input [1]: [d_date_sk#69]
Arguments: [d_date_sk#69]

(101) CometBroadcastHashJoin
Left output [4]: [ss_quantity#65, ss_sales_price#66, ss_sold_date_sk#67, c_customer_sk#68]
Right output [1]: [d_date_sk#69]
Arguments: [ss_sold_date_sk#67], [d_date_sk#69], Inner, BuildRight

(102) CometProject
Input [5]: [ss_quantity#65, ss_sales_price#66, ss_sold_date_sk#67, c_customer_sk#68, d_date_sk#69]
Arguments: [ss_quantity#65, ss_sales_price#66, c_customer_sk#68], [ss_quantity#65, ss_sales_price#66, c_customer_sk#68]

(103) ColumnarToRow [codegen id : 1]
Input [3]: [ss_quantity#65, ss_sales_price#66, c_customer_sk#68]

(104) HashAggregate [codegen id : 1]
Input [3]: [ss_quantity#65, ss_sales_price#66, c_customer_sk#68]
Keys [1]: [c_customer_sk#68]
Functions [1]: [partial_sum((cast(ss_quantity#65 as decimal(10,0)) * ss_sales_price#66))]
Aggregate Attributes [2]: [sum#71, isEmpty#72]
Results [3]: [c_customer_sk#68, sum#73, isEmpty#74]

(105) Exchange
Input [3]: [c_customer_sk#68, sum#73, isEmpty#74]
Arguments: hashpartitioning(c_customer_sk#68, 5), ENSURE_REQUIREMENTS, [plan_id=10]

(106) HashAggregate [codegen id : 2]
Input [3]: [c_customer_sk#68, sum#73, isEmpty#74]
Keys [1]: [c_customer_sk#68]
Functions [1]: [sum((cast(ss_quantity#65 as decimal(10,0)) * ss_sales_price#66))]
Aggregate Attributes [1]: [sum((cast(ss_quantity#65 as decimal(10,0)) * ss_sales_price#66))#75]
Results [1]: [sum((cast(ss_quantity#65 as decimal(10,0)) * ss_sales_price#66))#75 AS csales#76]

(107) HashAggregate [codegen id : 2]
Input [1]: [csales#76]
Keys: []
Functions [1]: [partial_max(csales#76)]
Aggregate Attributes [1]: [max#77]
Results [1]: [max#78]

(108) Exchange
Input [1]: [max#78]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=11]

(109) HashAggregate [codegen id : 3]
Input [1]: [max#78]
Keys: []
Functions [1]: [max(csales#76)]
Aggregate Attributes [1]: [max(csales#76)#79]
Results [1]: [max(csales#76)#79 AS tpcds_cmax#80]

Subquery:2 Hosting operator id = 50 Hosting Expression = ReusedSubquery Subquery scalar-subquery#28, [id=#29]

Subquery:3 Hosting operator id = 77 Hosting Expression = ReusedSubquery Subquery scalar-subquery#28, [id=#29]


