== Physical Plan ==
* ColumnarToRow (64)
+- CometTakeOrderedAndProject (63)
   +- CometProject (62)
      +- CometBroadcastHashJoin (61)
         :- CometProject (48)
         :  +- CometBroadcastHashJoin (47)
         :     :- CometBroadcastHashJoin (31)
         :     :  :- CometFilter (16)
         :     :  :  +- CometHashAggregate (15)
         :     :  :     +- CometExchange (14)
         :     :  :        +- CometHashAggregate (13)
         :     :  :           +- CometProject (12)
         :     :  :              +- CometBroadcastHashJoin (11)
         :     :  :                 :- CometProject (7)
         :     :  :                 :  +- CometBroadcastHashJoin (6)
         :     :  :                 :     :- CometFilter (2)
         :     :  :                 :     :  +- CometScan parquet spark_catalog.default.customer (1)
         :     :  :                 :     +- CometBroadcastExchange (5)
         :     :  :                 :        +- CometFilter (4)
         :     :  :                 :           +- CometScan parquet spark_catalog.default.store_sales (3)
         :     :  :                 +- CometBroadcastExchange (10)
         :     :  :                    +- CometFilter (9)
         :     :  :                       +- CometScan parquet spark_catalog.default.date_dim (8)
         :     :  +- CometBroadcastExchange (30)
         :     :     +- CometHashAggregate (29)
         :     :        +- CometExchange (28)
         :     :           +- CometHashAggregate (27)
         :     :              +- CometProject (26)
         :     :                 +- CometBroadcastHashJoin (25)
         :     :                    :- CometProject (21)
         :     :                    :  +- CometBroadcastHashJoin (20)
         :     :                    :     :- CometFilter (18)
         :     :                    :     :  +- CometScan parquet spark_catalog.default.customer (17)
         :     :                    :     +- ReusedExchange (19)
         :     :                    +- CometBroadcastExchange (24)
         :     :                       +- CometFilter (23)
         :     :                          +- CometScan parquet spark_catalog.default.date_dim (22)
         :     +- CometBroadcastExchange (46)
         :        +- CometFilter (45)
         :           +- CometHashAggregate (44)
         :              +- CometExchange (43)
         :                 +- CometHashAggregate (42)
         :                    +- CometProject (41)
         :                       +- CometBroadcastHashJoin (40)
         :                          :- CometProject (38)
         :                          :  +- CometBroadcastHashJoin (37)
         :                          :     :- CometFilter (33)
         :                          :     :  +- CometScan parquet spark_catalog.default.customer (32)
         :                          :     +- CometBroadcastExchange (36)
         :                          :        +- CometFilter (35)
         :                          :           +- CometScan parquet spark_catalog.default.web_sales (34)
         :                          +- ReusedExchange (39)
         +- CometBroadcastExchange (60)
            +- CometHashAggregate (59)
               +- CometExchange (58)
                  +- CometHashAggregate (57)
                     +- CometProject (56)
                        +- CometBroadcastHashJoin (55)
                           :- CometProject (53)
                           :  +- CometBroadcastHashJoin (52)
                           :     :- CometFilter (50)
                           :     :  +- CometScan parquet spark_catalog.default.customer (49)
                           :     +- ReusedExchange (51)
                           +- ReusedExchange (54)


(1) CometScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string>

(2) CometFilter
Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4]
Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2))

(3) CometScan parquet spark_catalog.default.store_sales
Output [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#7)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_net_paid:decimal(7,2)>

(4) CometFilter
Input [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7]
Condition : isnotnull(ss_customer_sk#5)

(5) CometBroadcastExchange
Input [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7]
Arguments: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7]

(6) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4]
Right output [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7]
Arguments: [c_customer_sk#1], [ss_customer_sk#5], Inner, BuildRight

(7) CometProject
Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7]
Arguments: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, ss_sold_date_sk#7], [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, ss_sold_date_sk#7]

(8) CometScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#8, d_year#9]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), In(d_year, [2001,2002]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(9) CometFilter
Input [2]: [d_date_sk#8, d_year#9]
Condition : (((isnotnull(d_year#9) AND (d_year#9 = 2001)) AND d_year#9 IN (2001,2002)) AND isnotnull(d_date_sk#8))

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

(11) CometBroadcastHashJoin
Left output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, ss_sold_date_sk#7]
Right output [2]: [d_date_sk#8, d_year#9]
Arguments: [ss_sold_date_sk#7], [d_date_sk#8], Inner, BuildRight

(12) CometProject
Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, ss_sold_date_sk#7, d_date_sk#8, d_year#9]
Arguments: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, d_year#9], [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, d_year#9]

(13) CometHashAggregate
Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, d_year#9]
Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#9]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#6))]

(14) CometExchange
Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#9, sum#10]
Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#9, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]

(15) CometHashAggregate
Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#9, sum#10]
Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#9]
Functions [1]: [sum(UnscaledValue(ss_net_paid#6))]

(16) CometFilter
Input [2]: [customer_id#11, year_total#12]
Condition : (isnotnull(year_total#12) AND (year_total#12 > 0.00))

(17) CometScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#13, c_customer_id#14, c_first_name#15, c_last_name#16]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string>

(18) CometFilter
Input [4]: [c_customer_sk#13, c_customer_id#14, c_first_name#15, c_last_name#16]
Condition : (isnotnull(c_customer_sk#13) AND isnotnull(c_customer_id#14))

(19) ReusedExchange [Reuses operator id: 5]
Output [3]: [ss_customer_sk#17, ss_net_paid#18, ss_sold_date_sk#19]

(20) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#13, c_customer_id#14, c_first_name#15, c_last_name#16]
Right output [3]: [ss_customer_sk#17, ss_net_paid#18, ss_sold_date_sk#19]
Arguments: [c_customer_sk#13], [ss_customer_sk#17], Inner, BuildRight

(21) CometProject
Input [7]: [c_customer_sk#13, c_customer_id#14, c_first_name#15, c_last_name#16, ss_customer_sk#17, ss_net_paid#18, ss_sold_date_sk#19]
Arguments: [c_customer_id#14, c_first_name#15, c_last_name#16, ss_net_paid#18, ss_sold_date_sk#19], [c_customer_id#14, c_first_name#15, c_last_name#16, ss_net_paid#18, ss_sold_date_sk#19]

(22) CometScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#20, d_year#21]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(23) CometFilter
Input [2]: [d_date_sk#20, d_year#21]
Condition : (((isnotnull(d_year#21) AND (d_year#21 = 2002)) AND d_year#21 IN (2001,2002)) AND isnotnull(d_date_sk#20))

(24) CometBroadcastExchange
Input [2]: [d_date_sk#20, d_year#21]
Arguments: [d_date_sk#20, d_year#21]

(25) CometBroadcastHashJoin
Left output [5]: [c_customer_id#14, c_first_name#15, c_last_name#16, ss_net_paid#18, ss_sold_date_sk#19]
Right output [2]: [d_date_sk#20, d_year#21]
Arguments: [ss_sold_date_sk#19], [d_date_sk#20], Inner, BuildRight

(26) CometProject
Input [7]: [c_customer_id#14, c_first_name#15, c_last_name#16, ss_net_paid#18, ss_sold_date_sk#19, d_date_sk#20, d_year#21]
Arguments: [c_customer_id#14, c_first_name#15, c_last_name#16, ss_net_paid#18, d_year#21], [c_customer_id#14, c_first_name#15, c_last_name#16, ss_net_paid#18, d_year#21]

(27) CometHashAggregate
Input [5]: [c_customer_id#14, c_first_name#15, c_last_name#16, ss_net_paid#18, d_year#21]
Keys [4]: [c_customer_id#14, c_first_name#15, c_last_name#16, d_year#21]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#18))]

(28) CometExchange
Input [5]: [c_customer_id#14, c_first_name#15, c_last_name#16, d_year#21, sum#22]
Arguments: hashpartitioning(c_customer_id#14, c_first_name#15, c_last_name#16, d_year#21, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=2]

(29) CometHashAggregate
Input [5]: [c_customer_id#14, c_first_name#15, c_last_name#16, d_year#21, sum#22]
Keys [4]: [c_customer_id#14, c_first_name#15, c_last_name#16, d_year#21]
Functions [1]: [sum(UnscaledValue(ss_net_paid#18))]

(30) CometBroadcastExchange
Input [4]: [customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26]
Arguments: [customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26]

(31) CometBroadcastHashJoin
Left output [2]: [customer_id#11, year_total#12]
Right output [4]: [customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26]
Arguments: [customer_id#11], [customer_id#23], Inner, BuildRight

(32) CometScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#27, c_customer_id#28, c_first_name#29, c_last_name#30]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string>

(33) CometFilter
Input [4]: [c_customer_sk#27, c_customer_id#28, c_first_name#29, c_last_name#30]
Condition : (isnotnull(c_customer_sk#27) AND isnotnull(c_customer_id#28))

(34) CometScan parquet spark_catalog.default.web_sales
Output [3]: [ws_bill_customer_sk#31, ws_net_paid#32, ws_sold_date_sk#33]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#33)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_net_paid:decimal(7,2)>

(35) CometFilter
Input [3]: [ws_bill_customer_sk#31, ws_net_paid#32, ws_sold_date_sk#33]
Condition : isnotnull(ws_bill_customer_sk#31)

(36) CometBroadcastExchange
Input [3]: [ws_bill_customer_sk#31, ws_net_paid#32, ws_sold_date_sk#33]
Arguments: [ws_bill_customer_sk#31, ws_net_paid#32, ws_sold_date_sk#33]

(37) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#27, c_customer_id#28, c_first_name#29, c_last_name#30]
Right output [3]: [ws_bill_customer_sk#31, ws_net_paid#32, ws_sold_date_sk#33]
Arguments: [c_customer_sk#27], [ws_bill_customer_sk#31], Inner, BuildRight

(38) CometProject
Input [7]: [c_customer_sk#27, c_customer_id#28, c_first_name#29, c_last_name#30, ws_bill_customer_sk#31, ws_net_paid#32, ws_sold_date_sk#33]
Arguments: [c_customer_id#28, c_first_name#29, c_last_name#30, ws_net_paid#32, ws_sold_date_sk#33], [c_customer_id#28, c_first_name#29, c_last_name#30, ws_net_paid#32, ws_sold_date_sk#33]

(39) ReusedExchange [Reuses operator id: 10]
Output [2]: [d_date_sk#34, d_year#35]

(40) CometBroadcastHashJoin
Left output [5]: [c_customer_id#28, c_first_name#29, c_last_name#30, ws_net_paid#32, ws_sold_date_sk#33]
Right output [2]: [d_date_sk#34, d_year#35]
Arguments: [ws_sold_date_sk#33], [d_date_sk#34], Inner, BuildRight

(41) CometProject
Input [7]: [c_customer_id#28, c_first_name#29, c_last_name#30, ws_net_paid#32, ws_sold_date_sk#33, d_date_sk#34, d_year#35]
Arguments: [c_customer_id#28, c_first_name#29, c_last_name#30, ws_net_paid#32, d_year#35], [c_customer_id#28, c_first_name#29, c_last_name#30, ws_net_paid#32, d_year#35]

(42) CometHashAggregate
Input [5]: [c_customer_id#28, c_first_name#29, c_last_name#30, ws_net_paid#32, d_year#35]
Keys [4]: [c_customer_id#28, c_first_name#29, c_last_name#30, d_year#35]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#32))]

(43) CometExchange
Input [5]: [c_customer_id#28, c_first_name#29, c_last_name#30, d_year#35, sum#36]
Arguments: hashpartitioning(c_customer_id#28, c_first_name#29, c_last_name#30, d_year#35, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=3]

(44) CometHashAggregate
Input [5]: [c_customer_id#28, c_first_name#29, c_last_name#30, d_year#35, sum#36]
Keys [4]: [c_customer_id#28, c_first_name#29, c_last_name#30, d_year#35]
Functions [1]: [sum(UnscaledValue(ws_net_paid#32))]

(45) CometFilter
Input [2]: [customer_id#37, year_total#38]
Condition : (isnotnull(year_total#38) AND (year_total#38 > 0.00))

(46) CometBroadcastExchange
Input [2]: [customer_id#37, year_total#38]
Arguments: [customer_id#37, year_total#38]

(47) CometBroadcastHashJoin
Left output [6]: [customer_id#11, year_total#12, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26]
Right output [2]: [customer_id#37, year_total#38]
Arguments: [customer_id#11], [customer_id#37], Inner, BuildRight

(48) CometProject
Input [8]: [customer_id#11, year_total#12, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, customer_id#37, year_total#38]
Arguments: [customer_id#11, year_total#12, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#38], [customer_id#11, year_total#12, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#38]

(49) CometScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#39, c_customer_id#40, c_first_name#41, c_last_name#42]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string>

(50) CometFilter
Input [4]: [c_customer_sk#39, c_customer_id#40, c_first_name#41, c_last_name#42]
Condition : (isnotnull(c_customer_sk#39) AND isnotnull(c_customer_id#40))

(51) ReusedExchange [Reuses operator id: 36]
Output [3]: [ws_bill_customer_sk#43, ws_net_paid#44, ws_sold_date_sk#45]

(52) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#39, c_customer_id#40, c_first_name#41, c_last_name#42]
Right output [3]: [ws_bill_customer_sk#43, ws_net_paid#44, ws_sold_date_sk#45]
Arguments: [c_customer_sk#39], [ws_bill_customer_sk#43], Inner, BuildRight

(53) CometProject
Input [7]: [c_customer_sk#39, c_customer_id#40, c_first_name#41, c_last_name#42, ws_bill_customer_sk#43, ws_net_paid#44, ws_sold_date_sk#45]
Arguments: [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, ws_sold_date_sk#45], [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, ws_sold_date_sk#45]

(54) ReusedExchange [Reuses operator id: 24]
Output [2]: [d_date_sk#46, d_year#47]

(55) CometBroadcastHashJoin
Left output [5]: [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, ws_sold_date_sk#45]
Right output [2]: [d_date_sk#46, d_year#47]
Arguments: [ws_sold_date_sk#45], [d_date_sk#46], Inner, BuildRight

(56) CometProject
Input [7]: [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, ws_sold_date_sk#45, d_date_sk#46, d_year#47]
Arguments: [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, d_year#47], [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, d_year#47]

(57) CometHashAggregate
Input [5]: [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, d_year#47]
Keys [4]: [c_customer_id#40, c_first_name#41, c_last_name#42, d_year#47]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#44))]

(58) CometExchange
Input [5]: [c_customer_id#40, c_first_name#41, c_last_name#42, d_year#47, sum#48]
Arguments: hashpartitioning(c_customer_id#40, c_first_name#41, c_last_name#42, d_year#47, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=4]

(59) CometHashAggregate
Input [5]: [c_customer_id#40, c_first_name#41, c_last_name#42, d_year#47, sum#48]
Keys [4]: [c_customer_id#40, c_first_name#41, c_last_name#42, d_year#47]
Functions [1]: [sum(UnscaledValue(ws_net_paid#44))]

(60) CometBroadcastExchange
Input [2]: [customer_id#49, year_total#50]
Arguments: [customer_id#49, year_total#50]

(61) CometBroadcastHashJoin
Left output [7]: [customer_id#11, year_total#12, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#38]
Right output [2]: [customer_id#49, year_total#50]
Arguments: [customer_id#11], [customer_id#49], Inner, (CASE WHEN (year_total#38 > 0.00) THEN (year_total#50 / year_total#38) END > CASE WHEN (year_total#12 > 0.00) THEN (year_total#26 / year_total#12) END), BuildRight

(62) CometProject
Input [9]: [customer_id#11, year_total#12, customer_id#23, customer_first_name#24, customer_last_name#25, year_total#26, year_total#38, customer_id#49, year_total#50]
Arguments: [customer_id#23, customer_first_name#24, customer_last_name#25], [customer_id#23, customer_first_name#24, customer_last_name#25]

(63) CometTakeOrderedAndProject
Input [3]: [customer_id#23, customer_first_name#24, customer_last_name#25]
Arguments: TakeOrderedAndProject(limit=100, orderBy=[customer_id#23 ASC NULLS FIRST,customer_id#23 ASC NULLS FIRST,customer_id#23 ASC NULLS FIRST], output=[customer_id#23,customer_first_name#24,customer_last_name#25]), [customer_id#23, customer_first_name#24, customer_last_name#25], 100, [customer_id#23 ASC NULLS FIRST, customer_id#23 ASC NULLS FIRST, customer_id#23 ASC NULLS FIRST], [customer_id#23, customer_first_name#24, customer_last_name#25]

(64) ColumnarToRow [codegen id : 1]
Input [3]: [customer_id#23, customer_first_name#24, customer_last_name#25]

