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


(1) Scan parquet spark_catalog.default.catalog_sales
Output [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)]
PushedFilters: [IsNotNull(cs_bill_customer_sk)]
ReadSchema: struct<cs_bill_customer_sk:int,cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2)>

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

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

(4) Scan parquet spark_catalog.default.store_sales
Output [2]: [ss_item_sk#7, ss_sold_date_sk#8]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)]
PushedFilters: [IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_item_sk:int>

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

(6) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#10, d_date#11, d_year#12]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date,d_year:int>

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

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

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

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

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

(12) Scan parquet spark_catalog.default.item
Output [2]: [i_item_sk#13, i_item_desc#14]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_item_desc:string>

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

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

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

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

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

(18) ColumnarToRow [codegen id : 1]
Input [4]: [_groupingexpression#15, i_item_sk#13, d_date#11, count#16]

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

(20) HashAggregate [codegen id : 2]
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)]
Aggregate Attributes [1]: [count(1)#17]
Results [2]: [i_item_sk#13 AS item_sk#18, count(1)#17 AS cnt#19]

(21) Filter [codegen id : 2]
Input [2]: [item_sk#18, cnt#19]
Condition : (cnt#19 > 4)

(22) Project [codegen id : 2]
Output [1]: [item_sk#18]
Input [2]: [item_sk#18, cnt#19]

(23) BroadcastExchange
Input [1]: [item_sk#18]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]

(24) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [cs_item_sk#2]
Right keys [1]: [item_sk#18]
Join type: LeftSemi
Join condition: None

(25) Project [codegen id : 3]
Output [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]

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

(27) Sort [codegen id : 4]
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 ASC NULLS FIRST], false, 0

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

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

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

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

(32) CometFilter
Input [1]: [c_customer_sk#24]
Condition : isnotnull(c_customer_sk#24)

(33) CometBroadcastExchange
Input [1]: [c_customer_sk#24]
Arguments: [c_customer_sk#24]

(34) CometBroadcastHashJoin
Left output [3]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22]
Right output [1]: [c_customer_sk#24]
Arguments: [ss_customer_sk#20], [c_customer_sk#24], Inner, BuildRight

(35) CometProject
Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, c_customer_sk#24]
Arguments: [ss_quantity#21, ss_sales_price#22, c_customer_sk#24], [ss_quantity#21, ss_sales_price#22, c_customer_sk#24]

(36) ColumnarToRow [codegen id : 5]
Input [3]: [ss_quantity#21, ss_sales_price#22, c_customer_sk#24]

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

(38) Exchange
Input [3]: [c_customer_sk#24, sum#27, isEmpty#28]
Arguments: hashpartitioning(c_customer_sk#24, 5), ENSURE_REQUIREMENTS, [plan_id=4]

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

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

(41) Project [codegen id : 6]
Output [1]: [c_customer_sk#24]
Input [2]: [c_customer_sk#24, ssales#30]

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

(43) SortMergeJoin [codegen id : 13]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#24]
Join type: LeftSemi
Join condition: None

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

(46) ColumnarToRow [codegen id : 7]
Input [3]: [c_customer_sk#33, c_first_name#34, c_last_name#35]

(47) Exchange
Input [3]: [c_customer_sk#33, c_first_name#34, c_last_name#35]
Arguments: hashpartitioning(c_customer_sk#33, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(48) Sort [codegen id : 8]
Input [3]: [c_customer_sk#33, c_first_name#34, c_last_name#35]
Arguments: [c_customer_sk#33 ASC NULLS FIRST], false, 0

(49) ReusedExchange [Reuses operator id: 38]
Output [3]: [c_customer_sk#24, sum#27, isEmpty#28]

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

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

(52) Project [codegen id : 10]
Output [1]: [c_customer_sk#24]
Input [2]: [c_customer_sk#24, ssales#30]

(53) Sort [codegen id : 10]
Input [1]: [c_customer_sk#24]
Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0

(54) SortMergeJoin [codegen id : 11]
Left keys [1]: [c_customer_sk#33]
Right keys [1]: [c_customer_sk#24]
Join type: LeftSemi
Join condition: None

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

(56) BroadcastHashJoin [codegen id : 13]
Left keys [1]: [cs_bill_customer_sk#1]
Right keys [1]: [c_customer_sk#33]
Join type: Inner
Join condition: None

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

(58) ReusedExchange [Reuses operator id: 93]
Output [1]: [d_date_sk#36]

(59) BroadcastHashJoin [codegen id : 13]
Left keys [1]: [cs_sold_date_sk#5]
Right keys [1]: [d_date_sk#36]
Join type: Inner
Join condition: None

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

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

(62) Exchange
Input [4]: [c_last_name#35, c_first_name#34, sum#39, isEmpty#40]
Arguments: hashpartitioning(c_last_name#35, c_first_name#34, 5), ENSURE_REQUIREMENTS, [plan_id=7]

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

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

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

(66) ColumnarToRow [codegen id : 17]
Input [5]: [ws_item_sk#43, ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]

(67) ReusedExchange [Reuses operator id: 23]
Output [1]: [item_sk#49]

(68) BroadcastHashJoin [codegen id : 17]
Left keys [1]: [ws_item_sk#43]
Right keys [1]: [item_sk#49]
Join type: LeftSemi
Join condition: None

(69) Project [codegen id : 17]
Output [4]: [ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]
Input [5]: [ws_item_sk#43, ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]

(70) Exchange
Input [4]: [ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]
Arguments: hashpartitioning(ws_bill_customer_sk#44, 5), ENSURE_REQUIREMENTS, [plan_id=8]

(71) Sort [codegen id : 18]
Input [4]: [ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]
Arguments: [ws_bill_customer_sk#44 ASC NULLS FIRST], false, 0

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

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

(74) Filter [codegen id : 20]
Input [2]: [c_customer_sk#50, ssales#55]
Condition : (isnotnull(ssales#55) AND (cast(ssales#55 as decimal(38,8)) > (0.500000 * ReusedSubquery Subquery scalar-subquery#31, [id=#32])))

(75) Project [codegen id : 20]
Output [1]: [c_customer_sk#50]
Input [2]: [c_customer_sk#50, ssales#55]

(76) Sort [codegen id : 20]
Input [1]: [c_customer_sk#50]
Arguments: [c_customer_sk#50 ASC NULLS FIRST], false, 0

(77) SortMergeJoin [codegen id : 27]
Left keys [1]: [ws_bill_customer_sk#44]
Right keys [1]: [c_customer_sk#50]
Join type: LeftSemi
Join condition: None

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

(79) BroadcastHashJoin [codegen id : 27]
Left keys [1]: [ws_bill_customer_sk#44]
Right keys [1]: [c_customer_sk#56]
Join type: Inner
Join condition: None

(80) Project [codegen id : 27]
Output [5]: [ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47, c_first_name#57, c_last_name#58]
Input [7]: [ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47, c_customer_sk#56, c_first_name#57, c_last_name#58]

(81) ReusedExchange [Reuses operator id: 93]
Output [1]: [d_date_sk#59]

(82) BroadcastHashJoin [codegen id : 27]
Left keys [1]: [ws_sold_date_sk#47]
Right keys [1]: [d_date_sk#59]
Join type: Inner
Join condition: None

(83) Project [codegen id : 27]
Output [4]: [ws_quantity#45, ws_list_price#46, c_first_name#57, c_last_name#58]
Input [6]: [ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47, c_first_name#57, c_last_name#58, d_date_sk#59]

(84) HashAggregate [codegen id : 27]
Input [4]: [ws_quantity#45, ws_list_price#46, c_first_name#57, c_last_name#58]
Keys [2]: [c_last_name#58, c_first_name#57]
Functions [1]: [partial_sum((cast(ws_quantity#45 as decimal(10,0)) * ws_list_price#46))]
Aggregate Attributes [2]: [sum#60, isEmpty#61]
Results [4]: [c_last_name#58, c_first_name#57, sum#62, isEmpty#63]

(85) Exchange
Input [4]: [c_last_name#58, c_first_name#57, sum#62, isEmpty#63]
Arguments: hashpartitioning(c_last_name#58, c_first_name#57, 5), ENSURE_REQUIREMENTS, [plan_id=9]

(86) HashAggregate [codegen id : 28]
Input [4]: [c_last_name#58, c_first_name#57, sum#62, isEmpty#63]
Keys [2]: [c_last_name#58, c_first_name#57]
Functions [1]: [sum((cast(ws_quantity#45 as decimal(10,0)) * ws_list_price#46))]
Aggregate Attributes [1]: [sum((cast(ws_quantity#45 as decimal(10,0)) * ws_list_price#46))#64]
Results [3]: [c_last_name#58, c_first_name#57, sum((cast(ws_quantity#45 as decimal(10,0)) * ws_list_price#46))#64 AS sales#65]

(87) Union

(88) TakeOrderedAndProject
Input [3]: [c_last_name#35, c_first_name#34, sales#42]
Arguments: 100, [c_last_name#35 ASC NULLS FIRST, c_first_name#34 ASC NULLS FIRST, sales#42 ASC NULLS FIRST], [c_last_name#35, c_first_name#34, sales#42]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6
BroadcastExchange (93)
+- * ColumnarToRow (92)
   +- CometProject (91)
      +- CometFilter (90)
         +- CometScan parquet spark_catalog.default.date_dim (89)


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

(90) CometFilter
Input [3]: [d_date_sk#36, d_year#66, d_moy#67]
Condition : ((((isnotnull(d_year#66) AND isnotnull(d_moy#67)) AND (d_year#66 = 2000)) AND (d_moy#67 = 2)) AND isnotnull(d_date_sk#36))

(91) CometProject
Input [3]: [d_date_sk#36, d_year#66, d_moy#67]
Arguments: [d_date_sk#36], [d_date_sk#36]

(92) ColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#36]

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

Subquery:2 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9
BroadcastExchange (98)
+- * ColumnarToRow (97)
   +- CometProject (96)
      +- CometFilter (95)
         +- CometScan parquet spark_catalog.default.date_dim (94)


(94) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#10, d_date#11, d_year#12]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date,d_year:int>

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

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

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

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

Subquery:3 Hosting operator id = 40 Hosting Expression = Subquery scalar-subquery#31, [id=#32]
* HashAggregate (116)
+- Exchange (115)
   +- * HashAggregate (114)
      +- * HashAggregate (113)
         +- Exchange (112)
            +- * HashAggregate (111)
               +- * ColumnarToRow (110)
                  +- CometProject (109)
                     +- CometBroadcastHashJoin (108)
                        :- CometProject (103)
                        :  +- CometBroadcastHashJoin (102)
                        :     :- CometFilter (100)
                        :     :  +- CometScan parquet spark_catalog.default.store_sales (99)
                        :     +- ReusedExchange (101)
                        +- CometBroadcastExchange (107)
                           +- CometProject (106)
                              +- CometFilter (105)
                                 +- CometScan parquet spark_catalog.default.date_dim (104)


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

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

(101) ReusedExchange [Reuses operator id: 33]
Output [1]: [c_customer_sk#73]

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

(103) CometProject
Input [5]: [ss_customer_sk#68, ss_quantity#69, ss_sales_price#70, ss_sold_date_sk#71, c_customer_sk#73]
Arguments: [ss_quantity#69, ss_sales_price#70, ss_sold_date_sk#71, c_customer_sk#73], [ss_quantity#69, ss_sales_price#70, ss_sold_date_sk#71, c_customer_sk#73]

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

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

(106) CometProject
Input [2]: [d_date_sk#74, d_year#75]
Arguments: [d_date_sk#74], [d_date_sk#74]

(107) CometBroadcastExchange
Input [1]: [d_date_sk#74]
Arguments: [d_date_sk#74]

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

(109) CometProject
Input [5]: [ss_quantity#69, ss_sales_price#70, ss_sold_date_sk#71, c_customer_sk#73, d_date_sk#74]
Arguments: [ss_quantity#69, ss_sales_price#70, c_customer_sk#73], [ss_quantity#69, ss_sales_price#70, c_customer_sk#73]

(110) ColumnarToRow [codegen id : 1]
Input [3]: [ss_quantity#69, ss_sales_price#70, c_customer_sk#73]

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

(112) Exchange
Input [3]: [c_customer_sk#73, sum#78, isEmpty#79]
Arguments: hashpartitioning(c_customer_sk#73, 5), ENSURE_REQUIREMENTS, [plan_id=12]

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

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

(115) Exchange
Input [1]: [max#83]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=13]

(116) HashAggregate [codegen id : 3]
Input [1]: [max#83]
Keys: []
Functions [1]: [max(csales#81)]
Aggregate Attributes [1]: [max(csales#81)#84]
Results [1]: [max(csales#81)#84 AS tpcds_cmax#85]

Subquery:4 Hosting operator id = 99 Hosting Expression = ss_sold_date_sk#71 IN dynamicpruning#72
BroadcastExchange (121)
+- * ColumnarToRow (120)
   +- CometProject (119)
      +- CometFilter (118)
         +- CometScan parquet spark_catalog.default.date_dim (117)


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

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

(119) CometProject
Input [2]: [d_date_sk#74, d_year#75]
Arguments: [d_date_sk#74], [d_date_sk#74]

(120) ColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#74]

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

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

Subquery:6 Hosting operator id = 64 Hosting Expression = ws_sold_date_sk#47 IN dynamicpruning#6

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


