== Physical Plan ==
* ColumnarToRow (48)
+- CometTakeOrderedAndProject (47)
   +- CometProject (46)
      +- CometBroadcastHashJoin (45)
         :- CometProject (40)
         :  +- CometBroadcastHashJoin (39)
         :     :- CometProject (35)
         :     :  +- CometBroadcastHashJoin (34)
         :     :     :- CometFilter (17)
         :     :     :  +- CometHashAggregate (16)
         :     :     :     +- CometExchange (15)
         :     :     :        +- CometHashAggregate (14)
         :     :     :           +- CometProject (13)
         :     :     :              +- CometBroadcastHashJoin (12)
         :     :     :                 :- CometProject (8)
         :     :     :                 :  +- CometBroadcastHashJoin (7)
         :     :     :                 :     :- CometFilter (2)
         :     :     :                 :     :  +- CometNativeScan: `spark_catalog`.`default`.`web_returns` (1)
         :     :     :                 :     +- CometBroadcastExchange (6)
         :     :     :                 :        +- CometProject (5)
         :     :     :                 :           +- CometFilter (4)
         :     :     :                 :              +- CometNativeScan: `spark_catalog`.`default`.`date_dim` (3)
         :     :     :                 +- CometBroadcastExchange (11)
         :     :     :                    +- CometFilter (10)
         :     :     :                       +- CometNativeScan: `spark_catalog`.`default`.`customer_address` (9)
         :     :     +- CometBroadcastExchange (33)
         :     :        +- CometFilter (32)
         :     :           +- CometHashAggregate (31)
         :     :              +- CometExchange (30)
         :     :                 +- CometHashAggregate (29)
         :     :                    +- CometHashAggregate (28)
         :     :                       +- CometExchange (27)
         :     :                          +- CometHashAggregate (26)
         :     :                             +- CometProject (25)
         :     :                                +- CometBroadcastHashJoin (24)
         :     :                                   :- CometProject (22)
         :     :                                   :  +- CometBroadcastHashJoin (21)
         :     :                                   :     :- CometFilter (19)
         :     :                                   :     :  +- CometNativeScan: `spark_catalog`.`default`.`web_returns` (18)
         :     :                                   :     +- ReusedExchange (20)
         :     :                                   +- ReusedExchange (23)
         :     +- CometBroadcastExchange (38)
         :        +- CometFilter (37)
         :           +- CometNativeScan: `spark_catalog`.`default`.`customer` (36)
         +- CometBroadcastExchange (44)
            +- CometProject (43)
               +- CometFilter (42)
                  +- CometNativeScan: `spark_catalog`.`default`.`customer_address` (41)


(1) CometNativeScan: `spark_catalog`.`default`.`web_returns`
Output [4]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4]
Arguments: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4]

(2) CometFilter
Input [4]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4]
Condition : (isnotnull(wr_returning_addr_sk#2) AND isnotnull(wr_returning_customer_sk#1))

(3) CometNativeScan: `spark_catalog`.`default`.`date_dim`
Output [2]: [d_date_sk#5, d_year#6]
Arguments: [d_date_sk#5, d_year#6]

(4) CometFilter
Input [2]: [d_date_sk#5, d_year#6]
Condition : ((isnotnull(d_year#6) AND (d_year#6 = 2002)) AND isnotnull(d_date_sk#5))

(5) CometProject
Input [2]: [d_date_sk#5, d_year#6]
Arguments: [d_date_sk#5], [d_date_sk#5]

(6) CometBroadcastExchange
Input [1]: [d_date_sk#5]
Arguments: [d_date_sk#5]

(7) CometBroadcastHashJoin
Left output [4]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4]
Right output [1]: [d_date_sk#5]
Arguments: [wr_returned_date_sk#4], [d_date_sk#5], Inner, BuildRight

(8) CometProject
Input [5]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4, d_date_sk#5]
Arguments: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3], [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3]

(9) CometNativeScan: `spark_catalog`.`default`.`customer_address`
Output [2]: [ca_address_sk#7, ca_state#8]
Arguments: [ca_address_sk#7, ca_state#8]

(10) CometFilter
Input [2]: [ca_address_sk#7, ca_state#8]
Condition : (isnotnull(ca_address_sk#7) AND isnotnull(ca_state#8))

(11) CometBroadcastExchange
Input [2]: [ca_address_sk#7, ca_state#8]
Arguments: [ca_address_sk#7, ca_state#8]

(12) CometBroadcastHashJoin
Left output [3]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3]
Right output [2]: [ca_address_sk#7, ca_state#8]
Arguments: [wr_returning_addr_sk#2], [ca_address_sk#7], Inner, BuildRight

(13) CometProject
Input [5]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, ca_address_sk#7, ca_state#8]
Arguments: [wr_returning_customer_sk#1, wr_return_amt#3, ca_state#8], [wr_returning_customer_sk#1, wr_return_amt#3, ca_state#8]

(14) CometHashAggregate
Input [3]: [wr_returning_customer_sk#1, wr_return_amt#3, ca_state#8]
Keys [2]: [wr_returning_customer_sk#1, ca_state#8]
Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#3))]

(15) CometExchange
Input [3]: [wr_returning_customer_sk#1, ca_state#8, sum#9]
Arguments: hashpartitioning(wr_returning_customer_sk#1, ca_state#8, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]

(16) CometHashAggregate
Input [3]: [wr_returning_customer_sk#1, ca_state#8, sum#9]
Keys [2]: [wr_returning_customer_sk#1, ca_state#8]
Functions [1]: [sum(UnscaledValue(wr_return_amt#3))]

(17) CometFilter
Input [3]: [ctr_customer_sk#10, ctr_state#11, ctr_total_return#12]
Condition : isnotnull(ctr_total_return#12)

(18) CometNativeScan: `spark_catalog`.`default`.`web_returns`
Output [4]: [wr_returning_customer_sk#13, wr_returning_addr_sk#14, wr_return_amt#15, wr_returned_date_sk#16]
Arguments: [wr_returning_customer_sk#13, wr_returning_addr_sk#14, wr_return_amt#15, wr_returned_date_sk#16]

(19) CometFilter
Input [4]: [wr_returning_customer_sk#13, wr_returning_addr_sk#14, wr_return_amt#15, wr_returned_date_sk#16]
Condition : isnotnull(wr_returning_addr_sk#14)

(20) ReusedExchange [Reuses operator id: 6]
Output [1]: [d_date_sk#17]

(21) CometBroadcastHashJoin
Left output [4]: [wr_returning_customer_sk#13, wr_returning_addr_sk#14, wr_return_amt#15, wr_returned_date_sk#16]
Right output [1]: [d_date_sk#17]
Arguments: [wr_returned_date_sk#16], [d_date_sk#17], Inner, BuildRight

(22) CometProject
Input [5]: [wr_returning_customer_sk#13, wr_returning_addr_sk#14, wr_return_amt#15, wr_returned_date_sk#16, d_date_sk#17]
Arguments: [wr_returning_customer_sk#13, wr_returning_addr_sk#14, wr_return_amt#15], [wr_returning_customer_sk#13, wr_returning_addr_sk#14, wr_return_amt#15]

(23) ReusedExchange [Reuses operator id: 11]
Output [2]: [ca_address_sk#18, ca_state#19]

(24) CometBroadcastHashJoin
Left output [3]: [wr_returning_customer_sk#13, wr_returning_addr_sk#14, wr_return_amt#15]
Right output [2]: [ca_address_sk#18, ca_state#19]
Arguments: [wr_returning_addr_sk#14], [ca_address_sk#18], Inner, BuildRight

(25) CometProject
Input [5]: [wr_returning_customer_sk#13, wr_returning_addr_sk#14, wr_return_amt#15, ca_address_sk#18, ca_state#19]
Arguments: [wr_returning_customer_sk#13, wr_return_amt#15, ca_state#19], [wr_returning_customer_sk#13, wr_return_amt#15, ca_state#19]

(26) CometHashAggregate
Input [3]: [wr_returning_customer_sk#13, wr_return_amt#15, ca_state#19]
Keys [2]: [wr_returning_customer_sk#13, ca_state#19]
Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#15))]

(27) CometExchange
Input [3]: [wr_returning_customer_sk#13, ca_state#19, sum#20]
Arguments: hashpartitioning(wr_returning_customer_sk#13, ca_state#19, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=2]

(28) CometHashAggregate
Input [3]: [wr_returning_customer_sk#13, ca_state#19, sum#20]
Keys [2]: [wr_returning_customer_sk#13, ca_state#19]
Functions [1]: [sum(UnscaledValue(wr_return_amt#15))]

(29) CometHashAggregate
Input [2]: [ctr_state#21, ctr_total_return#22]
Keys [1]: [ctr_state#21]
Functions [1]: [partial_avg(ctr_total_return#22)]

(30) CometExchange
Input [3]: [ctr_state#21, sum#23, count#24]
Arguments: hashpartitioning(ctr_state#21, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=3]

(31) CometHashAggregate
Input [3]: [ctr_state#21, sum#23, count#24]
Keys [1]: [ctr_state#21]
Functions [1]: [avg(ctr_total_return#22)]

(32) CometFilter
Input [2]: [(avg(ctr_total_return) * 1.2)#25, ctr_state#21]
Condition : isnotnull((avg(ctr_total_return) * 1.2)#25)

(33) CometBroadcastExchange
Input [2]: [(avg(ctr_total_return) * 1.2)#25, ctr_state#21]
Arguments: [(avg(ctr_total_return) * 1.2)#25, ctr_state#21]

(34) CometBroadcastHashJoin
Left output [3]: [ctr_customer_sk#10, ctr_state#11, ctr_total_return#12]
Right output [2]: [(avg(ctr_total_return) * 1.2)#25, ctr_state#21]
Arguments: [ctr_state#11], [ctr_state#21], Inner, (cast(ctr_total_return#12 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#25), BuildRight

(35) CometProject
Input [5]: [ctr_customer_sk#10, ctr_state#11, ctr_total_return#12, (avg(ctr_total_return) * 1.2)#25, ctr_state#21]
Arguments: [ctr_customer_sk#10, ctr_total_return#12], [ctr_customer_sk#10, ctr_total_return#12]

(36) CometNativeScan: `spark_catalog`.`default`.`customer`
Output [14]: [c_customer_sk#26, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39]
Arguments: [c_customer_sk#26, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39]

(37) CometFilter
Input [14]: [c_customer_sk#26, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39]
Condition : (isnotnull(c_customer_sk#26) AND isnotnull(c_current_addr_sk#28))

(38) CometBroadcastExchange
Input [14]: [c_customer_sk#26, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39]
Arguments: [c_customer_sk#26, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39]

(39) CometBroadcastHashJoin
Left output [2]: [ctr_customer_sk#10, ctr_total_return#12]
Right output [14]: [c_customer_sk#26, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39]
Arguments: [ctr_customer_sk#10], [c_customer_sk#26], Inner, BuildRight

(40) CometProject
Input [16]: [ctr_customer_sk#10, ctr_total_return#12, c_customer_sk#26, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39]
Arguments: [ctr_total_return#12, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39], [ctr_total_return#12, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39]

(41) CometNativeScan: `spark_catalog`.`default`.`customer_address`
Output [2]: [ca_address_sk#40, ca_state#41]
Arguments: [ca_address_sk#40, ca_state#41]

(42) CometFilter
Input [2]: [ca_address_sk#40, ca_state#41]
Condition : ((isnotnull(ca_state#41) AND (ca_state#41 = GA)) AND isnotnull(ca_address_sk#40))

(43) CometProject
Input [2]: [ca_address_sk#40, ca_state#41]
Arguments: [ca_address_sk#40], [ca_address_sk#40]

(44) CometBroadcastExchange
Input [1]: [ca_address_sk#40]
Arguments: [ca_address_sk#40]

(45) CometBroadcastHashJoin
Left output [14]: [ctr_total_return#12, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39]
Right output [1]: [ca_address_sk#40]
Arguments: [c_current_addr_sk#28], [ca_address_sk#40], Inner, BuildRight

(46) CometProject
Input [15]: [ctr_total_return#12, c_customer_id#27, c_current_addr_sk#28, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39, ca_address_sk#40]
Arguments: [c_customer_id#27, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39, ctr_total_return#12], [c_customer_id#27, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39, ctr_total_return#12]

(47) CometTakeOrderedAndProject
Input [13]: [c_customer_id#27, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39, ctr_total_return#12]
Arguments: TakeOrderedAndProject(limit=100, orderBy=[c_customer_id#27 ASC NULLS FIRST,c_salutation#29 ASC NULLS FIRST,c_first_name#30 ASC NULLS FIRST,c_last_name#31 ASC NULLS FIRST,c_preferred_cust_flag#32 ASC NULLS FIRST,c_birth_day#33 ASC NULLS FIRST,c_birth_month#34 ASC NULLS FIRST,c_birth_year#35 ASC NULLS FIRST,c_birth_country#36 ASC NULLS FIRST,c_login#37 ASC NULLS FIRST,c_email_address#38 ASC NULLS FIRST,c_last_review_date#39 ASC NULLS FIRST,ctr_total_return#12 ASC NULLS FIRST], output=[c_customer_id#27,c_salutation#29,c_first_name#30,c_last_name#31,c_preferred_cust_flag#32,c_birth_day#33,c_birth_month#34,c_birth_year#35,c_birth_country#36,c_login#37,c_email_address#38,c_last_review_date#39,ctr_total_return#12]), [c_customer_id#27, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39, ctr_total_return#12], 100, [c_customer_id#27 ASC NULLS FIRST, c_salutation#29 ASC NULLS FIRST, c_first_name#30 ASC NULLS FIRST, c_last_name#31 ASC NULLS FIRST, c_preferred_cust_flag#32 ASC NULLS FIRST, c_birth_day#33 ASC NULLS FIRST, c_birth_month#34 ASC NULLS FIRST, c_birth_year#35 ASC NULLS FIRST, c_birth_country#36 ASC NULLS FIRST, c_login#37 ASC NULLS FIRST, c_email_address#38 ASC NULLS FIRST, c_last_review_date#39 ASC NULLS FIRST, ctr_total_return#12 ASC NULLS FIRST], [c_customer_id#27, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39, ctr_total_return#12]

(48) ColumnarToRow [codegen id : 1]
Input [13]: [c_customer_id#27, c_salutation#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_day#33, c_birth_month#34, c_birth_year#35, c_birth_country#36, c_login#37, c_email_address#38, c_last_review_date#39, ctr_total_return#12]

