== Physical Plan ==
TakeOrderedAndProject (102)
+- * HashAggregate (101)
   +- Exchange (100)
      +- * HashAggregate (99)
         +- Union (98)
            :- * HashAggregate (87)
            :  +- Exchange (86)
            :     +- * HashAggregate (85)
            :        +- Union (84)
            :           :- * Project (34)
            :           :  +- * BroadcastHashJoin LeftOuter BuildRight (33)
            :           :     :- * HashAggregate (19)
            :           :     :  +- Exchange (18)
            :           :     :     +- * HashAggregate (17)
            :           :     :        +- * Project (16)
            :           :     :           +- * BroadcastHashJoin Inner BuildRight (15)
            :           :     :              :- * Project (10)
            :           :     :              :  +- * BroadcastHashJoin Inner BuildRight (9)
            :           :     :              :     :- * Filter (3)
            :           :     :              :     :  +- * ColumnarToRow (2)
            :           :     :              :     :     +- Scan parquet spark_catalog.default.store_sales (1)
            :           :     :              :     +- BroadcastExchange (8)
            :           :     :              :        +- * Project (7)
            :           :     :              :           +- * Filter (6)
            :           :     :              :              +- * ColumnarToRow (5)
            :           :     :              :                 +- Scan parquet spark_catalog.default.date_dim (4)
            :           :     :              +- BroadcastExchange (14)
            :           :     :                 +- * Filter (13)
            :           :     :                    +- * ColumnarToRow (12)
            :           :     :                       +- Scan parquet spark_catalog.default.store (11)
            :           :     +- BroadcastExchange (32)
            :           :        +- * HashAggregate (31)
            :           :           +- Exchange (30)
            :           :              +- * HashAggregate (29)
            :           :                 +- * Project (28)
            :           :                    +- * BroadcastHashJoin Inner BuildRight (27)
            :           :                       :- * Project (25)
            :           :                       :  +- * BroadcastHashJoin Inner BuildRight (24)
            :           :                       :     :- * Filter (22)
            :           :                       :     :  +- * ColumnarToRow (21)
            :           :                       :     :     +- Scan parquet spark_catalog.default.store_returns (20)
            :           :                       :     +- ReusedExchange (23)
            :           :                       +- ReusedExchange (26)
            :           :- * Project (53)
            :           :  +- * BroadcastNestedLoopJoin Inner BuildLeft (52)
            :           :     :- BroadcastExchange (43)
            :           :     :  +- * HashAggregate (42)
            :           :     :     +- Exchange (41)
            :           :     :        +- * HashAggregate (40)
            :           :     :           +- * Project (39)
            :           :     :              +- * BroadcastHashJoin Inner BuildRight (38)
            :           :     :                 :- * ColumnarToRow (36)
            :           :     :                 :  +- Scan parquet spark_catalog.default.catalog_sales (35)
            :           :     :                 +- ReusedExchange (37)
            :           :     +- * HashAggregate (51)
            :           :        +- Exchange (50)
            :           :           +- * HashAggregate (49)
            :           :              +- * Project (48)
            :           :                 +- * BroadcastHashJoin Inner BuildRight (47)
            :           :                    :- * ColumnarToRow (45)
            :           :                    :  +- Scan parquet spark_catalog.default.catalog_returns (44)
            :           :                    +- ReusedExchange (46)
            :           +- * Project (83)
            :              +- * BroadcastHashJoin LeftOuter BuildRight (82)
            :                 :- * HashAggregate (68)
            :                 :  +- Exchange (67)
            :                 :     +- * HashAggregate (66)
            :                 :        +- * Project (65)
            :                 :           +- * BroadcastHashJoin Inner BuildRight (64)
            :                 :              :- * Project (59)
            :                 :              :  +- * BroadcastHashJoin Inner BuildRight (58)
            :                 :              :     :- * Filter (56)
            :                 :              :     :  +- * ColumnarToRow (55)
            :                 :              :     :     +- Scan parquet spark_catalog.default.web_sales (54)
            :                 :              :     +- ReusedExchange (57)
            :                 :              +- BroadcastExchange (63)
            :                 :                 +- * Filter (62)
            :                 :                    +- * ColumnarToRow (61)
            :                 :                       +- Scan parquet spark_catalog.default.web_page (60)
            :                 +- BroadcastExchange (81)
            :                    +- * HashAggregate (80)
            :                       +- Exchange (79)
            :                          +- * HashAggregate (78)
            :                             +- * Project (77)
            :                                +- * BroadcastHashJoin Inner BuildRight (76)
            :                                   :- * Project (74)
            :                                   :  +- * BroadcastHashJoin Inner BuildRight (73)
            :                                   :     :- * Filter (71)
            :                                   :     :  +- * ColumnarToRow (70)
            :                                   :     :     +- Scan parquet spark_catalog.default.web_returns (69)
            :                                   :     +- ReusedExchange (72)
            :                                   +- ReusedExchange (75)
            :- * HashAggregate (92)
            :  +- Exchange (91)
            :     +- * HashAggregate (90)
            :        +- * HashAggregate (89)
            :           +- ReusedExchange (88)
            +- * HashAggregate (97)
               +- Exchange (96)
                  +- * HashAggregate (95)
                     +- * HashAggregate (94)
                        +- ReusedExchange (93)


(1) Scan parquet spark_catalog.default.store_sales
Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#4)]
PushedFilters: [IsNotNull(ss_store_sk)]
ReadSchema: struct<ss_store_sk:int,ss_ext_sales_price:decimal(7,2),ss_net_profit:decimal(7,2)>

(2) ColumnarToRow [codegen id : 3]
Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4]

(3) Filter [codegen id : 3]
Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4]
Condition : isnotnull(ss_store_sk#1)

(4) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#5, d_date#6]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1998-08-04), LessThanOrEqual(d_date,1998-09-03), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date>

(5) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#5, d_date#6]

(6) Filter [codegen id : 1]
Input [2]: [d_date_sk#5, d_date#6]
Condition : (((isnotnull(d_date#6) AND (d_date#6 >= 1998-08-04)) AND (d_date#6 <= 1998-09-03)) AND isnotnull(d_date_sk#5))

(7) Project [codegen id : 1]
Output [1]: [d_date_sk#5]
Input [2]: [d_date_sk#5, d_date#6]

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

(9) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ss_sold_date_sk#4]
Right keys [1]: [d_date_sk#5]
Join type: Inner
Join condition: None

(10) Project [codegen id : 3]
Output [3]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3]
Input [5]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4, d_date_sk#5]

(11) Scan parquet spark_catalog.default.store
Output [1]: [s_store_sk#7]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store]
PushedFilters: [IsNotNull(s_store_sk)]
ReadSchema: struct<s_store_sk:int>

(12) ColumnarToRow [codegen id : 2]
Input [1]: [s_store_sk#7]

(13) Filter [codegen id : 2]
Input [1]: [s_store_sk#7]
Condition : isnotnull(s_store_sk#7)

(14) BroadcastExchange
Input [1]: [s_store_sk#7]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]

(15) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ss_store_sk#1]
Right keys [1]: [s_store_sk#7]
Join type: Inner
Join condition: None

(16) Project [codegen id : 3]
Output [3]: [ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#7]
Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#7]

(17) HashAggregate [codegen id : 3]
Input [3]: [ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#7]
Keys [1]: [s_store_sk#7]
Functions [2]: [partial_sum(UnscaledValue(ss_ext_sales_price#2)), partial_sum(UnscaledValue(ss_net_profit#3))]
Aggregate Attributes [2]: [sum#8, sum#9]
Results [3]: [s_store_sk#7, sum#10, sum#11]

(18) Exchange
Input [3]: [s_store_sk#7, sum#10, sum#11]
Arguments: hashpartitioning(s_store_sk#7, 5), ENSURE_REQUIREMENTS, [plan_id=3]

(19) HashAggregate [codegen id : 8]
Input [3]: [s_store_sk#7, sum#10, sum#11]
Keys [1]: [s_store_sk#7]
Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#2)), sum(UnscaledValue(ss_net_profit#3))]
Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#2))#12, sum(UnscaledValue(ss_net_profit#3))#13]
Results [3]: [s_store_sk#7, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#12,17,2) AS sales#14, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#13,17,2) AS profit#15]

(20) Scan parquet spark_catalog.default.store_returns
Output [4]: [sr_store_sk#16, sr_return_amt#17, sr_net_loss#18, sr_returned_date_sk#19]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(sr_returned_date_sk#19)]
PushedFilters: [IsNotNull(sr_store_sk)]
ReadSchema: struct<sr_store_sk:int,sr_return_amt:decimal(7,2),sr_net_loss:decimal(7,2)>

(21) ColumnarToRow [codegen id : 6]
Input [4]: [sr_store_sk#16, sr_return_amt#17, sr_net_loss#18, sr_returned_date_sk#19]

(22) Filter [codegen id : 6]
Input [4]: [sr_store_sk#16, sr_return_amt#17, sr_net_loss#18, sr_returned_date_sk#19]
Condition : isnotnull(sr_store_sk#16)

(23) ReusedExchange [Reuses operator id: 8]
Output [1]: [d_date_sk#20]

(24) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [sr_returned_date_sk#19]
Right keys [1]: [d_date_sk#20]
Join type: Inner
Join condition: None

(25) Project [codegen id : 6]
Output [3]: [sr_store_sk#16, sr_return_amt#17, sr_net_loss#18]
Input [5]: [sr_store_sk#16, sr_return_amt#17, sr_net_loss#18, sr_returned_date_sk#19, d_date_sk#20]

(26) ReusedExchange [Reuses operator id: 14]
Output [1]: [s_store_sk#21]

(27) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [sr_store_sk#16]
Right keys [1]: [s_store_sk#21]
Join type: Inner
Join condition: None

(28) Project [codegen id : 6]
Output [3]: [sr_return_amt#17, sr_net_loss#18, s_store_sk#21]
Input [4]: [sr_store_sk#16, sr_return_amt#17, sr_net_loss#18, s_store_sk#21]

(29) HashAggregate [codegen id : 6]
Input [3]: [sr_return_amt#17, sr_net_loss#18, s_store_sk#21]
Keys [1]: [s_store_sk#21]
Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#17)), partial_sum(UnscaledValue(sr_net_loss#18))]
Aggregate Attributes [2]: [sum#22, sum#23]
Results [3]: [s_store_sk#21, sum#24, sum#25]

(30) Exchange
Input [3]: [s_store_sk#21, sum#24, sum#25]
Arguments: hashpartitioning(s_store_sk#21, 5), ENSURE_REQUIREMENTS, [plan_id=4]

(31) HashAggregate [codegen id : 7]
Input [3]: [s_store_sk#21, sum#24, sum#25]
Keys [1]: [s_store_sk#21]
Functions [2]: [sum(UnscaledValue(sr_return_amt#17)), sum(UnscaledValue(sr_net_loss#18))]
Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#17))#26, sum(UnscaledValue(sr_net_loss#18))#27]
Results [3]: [s_store_sk#21, MakeDecimal(sum(UnscaledValue(sr_return_amt#17))#26,17,2) AS returns#28, MakeDecimal(sum(UnscaledValue(sr_net_loss#18))#27,17,2) AS profit_loss#29]

(32) BroadcastExchange
Input [3]: [s_store_sk#21, returns#28, profit_loss#29]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]

(33) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [s_store_sk#7]
Right keys [1]: [s_store_sk#21]
Join type: LeftOuter
Join condition: None

(34) Project [codegen id : 8]
Output [5]: [store channel AS channel#30, s_store_sk#7 AS id#31, sales#14, coalesce(returns#28, 0.00) AS returns#32, (profit#15 - coalesce(profit_loss#29, 0.00)) AS profit#33]
Input [6]: [s_store_sk#7, sales#14, profit#15, s_store_sk#21, returns#28, profit_loss#29]

(35) Scan parquet spark_catalog.default.catalog_sales
Output [4]: [cs_call_center_sk#34, cs_ext_sales_price#35, cs_net_profit#36, cs_sold_date_sk#37]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#37)]
ReadSchema: struct<cs_call_center_sk:int,cs_ext_sales_price:decimal(7,2),cs_net_profit:decimal(7,2)>

(36) ColumnarToRow [codegen id : 10]
Input [4]: [cs_call_center_sk#34, cs_ext_sales_price#35, cs_net_profit#36, cs_sold_date_sk#37]

(37) ReusedExchange [Reuses operator id: 8]
Output [1]: [d_date_sk#38]

(38) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [cs_sold_date_sk#37]
Right keys [1]: [d_date_sk#38]
Join type: Inner
Join condition: None

(39) Project [codegen id : 10]
Output [3]: [cs_call_center_sk#34, cs_ext_sales_price#35, cs_net_profit#36]
Input [5]: [cs_call_center_sk#34, cs_ext_sales_price#35, cs_net_profit#36, cs_sold_date_sk#37, d_date_sk#38]

(40) HashAggregate [codegen id : 10]
Input [3]: [cs_call_center_sk#34, cs_ext_sales_price#35, cs_net_profit#36]
Keys [1]: [cs_call_center_sk#34]
Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#35)), partial_sum(UnscaledValue(cs_net_profit#36))]
Aggregate Attributes [2]: [sum#39, sum#40]
Results [3]: [cs_call_center_sk#34, sum#41, sum#42]

(41) Exchange
Input [3]: [cs_call_center_sk#34, sum#41, sum#42]
Arguments: hashpartitioning(cs_call_center_sk#34, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(42) HashAggregate [codegen id : 11]
Input [3]: [cs_call_center_sk#34, sum#41, sum#42]
Keys [1]: [cs_call_center_sk#34]
Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#35)), sum(UnscaledValue(cs_net_profit#36))]
Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#35))#43, sum(UnscaledValue(cs_net_profit#36))#44]
Results [3]: [cs_call_center_sk#34, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#35))#43,17,2) AS sales#45, MakeDecimal(sum(UnscaledValue(cs_net_profit#36))#44,17,2) AS profit#46]

(43) BroadcastExchange
Input [3]: [cs_call_center_sk#34, sales#45, profit#46]
Arguments: IdentityBroadcastMode, [plan_id=7]

(44) Scan parquet spark_catalog.default.catalog_returns
Output [3]: [cr_return_amount#47, cr_net_loss#48, cr_returned_date_sk#49]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cr_returned_date_sk#49)]
ReadSchema: struct<cr_return_amount:decimal(7,2),cr_net_loss:decimal(7,2)>

(45) ColumnarToRow [codegen id : 13]
Input [3]: [cr_return_amount#47, cr_net_loss#48, cr_returned_date_sk#49]

(46) ReusedExchange [Reuses operator id: 8]
Output [1]: [d_date_sk#50]

(47) BroadcastHashJoin [codegen id : 13]
Left keys [1]: [cr_returned_date_sk#49]
Right keys [1]: [d_date_sk#50]
Join type: Inner
Join condition: None

(48) Project [codegen id : 13]
Output [2]: [cr_return_amount#47, cr_net_loss#48]
Input [4]: [cr_return_amount#47, cr_net_loss#48, cr_returned_date_sk#49, d_date_sk#50]

(49) HashAggregate [codegen id : 13]
Input [2]: [cr_return_amount#47, cr_net_loss#48]
Keys: []
Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#47)), partial_sum(UnscaledValue(cr_net_loss#48))]
Aggregate Attributes [2]: [sum#51, sum#52]
Results [2]: [sum#53, sum#54]

(50) Exchange
Input [2]: [sum#53, sum#54]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=8]

(51) HashAggregate
Input [2]: [sum#53, sum#54]
Keys: []
Functions [2]: [sum(UnscaledValue(cr_return_amount#47)), sum(UnscaledValue(cr_net_loss#48))]
Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#47))#55, sum(UnscaledValue(cr_net_loss#48))#56]
Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#47))#55,17,2) AS returns#57, MakeDecimal(sum(UnscaledValue(cr_net_loss#48))#56,17,2) AS profit_loss#58]

(52) BroadcastNestedLoopJoin [codegen id : 14]
Join type: Inner
Join condition: None

(53) Project [codegen id : 14]
Output [5]: [catalog channel AS channel#59, cs_call_center_sk#34 AS id#60, sales#45, returns#57, (profit#46 - profit_loss#58) AS profit#61]
Input [5]: [cs_call_center_sk#34, sales#45, profit#46, returns#57, profit_loss#58]

(54) Scan parquet spark_catalog.default.web_sales
Output [4]: [ws_web_page_sk#62, ws_ext_sales_price#63, ws_net_profit#64, ws_sold_date_sk#65]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#65)]
PushedFilters: [IsNotNull(ws_web_page_sk)]
ReadSchema: struct<ws_web_page_sk:int,ws_ext_sales_price:decimal(7,2),ws_net_profit:decimal(7,2)>

(55) ColumnarToRow [codegen id : 17]
Input [4]: [ws_web_page_sk#62, ws_ext_sales_price#63, ws_net_profit#64, ws_sold_date_sk#65]

(56) Filter [codegen id : 17]
Input [4]: [ws_web_page_sk#62, ws_ext_sales_price#63, ws_net_profit#64, ws_sold_date_sk#65]
Condition : isnotnull(ws_web_page_sk#62)

(57) ReusedExchange [Reuses operator id: 8]
Output [1]: [d_date_sk#66]

(58) BroadcastHashJoin [codegen id : 17]
Left keys [1]: [ws_sold_date_sk#65]
Right keys [1]: [d_date_sk#66]
Join type: Inner
Join condition: None

(59) Project [codegen id : 17]
Output [3]: [ws_web_page_sk#62, ws_ext_sales_price#63, ws_net_profit#64]
Input [5]: [ws_web_page_sk#62, ws_ext_sales_price#63, ws_net_profit#64, ws_sold_date_sk#65, d_date_sk#66]

(60) Scan parquet spark_catalog.default.web_page
Output [1]: [wp_web_page_sk#67]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_page]
PushedFilters: [IsNotNull(wp_web_page_sk)]
ReadSchema: struct<wp_web_page_sk:int>

(61) ColumnarToRow [codegen id : 16]
Input [1]: [wp_web_page_sk#67]

(62) Filter [codegen id : 16]
Input [1]: [wp_web_page_sk#67]
Condition : isnotnull(wp_web_page_sk#67)

(63) BroadcastExchange
Input [1]: [wp_web_page_sk#67]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=9]

(64) BroadcastHashJoin [codegen id : 17]
Left keys [1]: [ws_web_page_sk#62]
Right keys [1]: [wp_web_page_sk#67]
Join type: Inner
Join condition: None

(65) Project [codegen id : 17]
Output [3]: [ws_ext_sales_price#63, ws_net_profit#64, wp_web_page_sk#67]
Input [4]: [ws_web_page_sk#62, ws_ext_sales_price#63, ws_net_profit#64, wp_web_page_sk#67]

(66) HashAggregate [codegen id : 17]
Input [3]: [ws_ext_sales_price#63, ws_net_profit#64, wp_web_page_sk#67]
Keys [1]: [wp_web_page_sk#67]
Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#63)), partial_sum(UnscaledValue(ws_net_profit#64))]
Aggregate Attributes [2]: [sum#68, sum#69]
Results [3]: [wp_web_page_sk#67, sum#70, sum#71]

(67) Exchange
Input [3]: [wp_web_page_sk#67, sum#70, sum#71]
Arguments: hashpartitioning(wp_web_page_sk#67, 5), ENSURE_REQUIREMENTS, [plan_id=10]

(68) HashAggregate [codegen id : 22]
Input [3]: [wp_web_page_sk#67, sum#70, sum#71]
Keys [1]: [wp_web_page_sk#67]
Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#63)), sum(UnscaledValue(ws_net_profit#64))]
Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#63))#72, sum(UnscaledValue(ws_net_profit#64))#73]
Results [3]: [wp_web_page_sk#67, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#63))#72,17,2) AS sales#74, MakeDecimal(sum(UnscaledValue(ws_net_profit#64))#73,17,2) AS profit#75]

(69) Scan parquet spark_catalog.default.web_returns
Output [4]: [wr_web_page_sk#76, wr_return_amt#77, wr_net_loss#78, wr_returned_date_sk#79]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(wr_returned_date_sk#79)]
PushedFilters: [IsNotNull(wr_web_page_sk)]
ReadSchema: struct<wr_web_page_sk:int,wr_return_amt:decimal(7,2),wr_net_loss:decimal(7,2)>

(70) ColumnarToRow [codegen id : 20]
Input [4]: [wr_web_page_sk#76, wr_return_amt#77, wr_net_loss#78, wr_returned_date_sk#79]

(71) Filter [codegen id : 20]
Input [4]: [wr_web_page_sk#76, wr_return_amt#77, wr_net_loss#78, wr_returned_date_sk#79]
Condition : isnotnull(wr_web_page_sk#76)

(72) ReusedExchange [Reuses operator id: 8]
Output [1]: [d_date_sk#80]

(73) BroadcastHashJoin [codegen id : 20]
Left keys [1]: [wr_returned_date_sk#79]
Right keys [1]: [d_date_sk#80]
Join type: Inner
Join condition: None

(74) Project [codegen id : 20]
Output [3]: [wr_web_page_sk#76, wr_return_amt#77, wr_net_loss#78]
Input [5]: [wr_web_page_sk#76, wr_return_amt#77, wr_net_loss#78, wr_returned_date_sk#79, d_date_sk#80]

(75) ReusedExchange [Reuses operator id: 63]
Output [1]: [wp_web_page_sk#81]

(76) BroadcastHashJoin [codegen id : 20]
Left keys [1]: [wr_web_page_sk#76]
Right keys [1]: [wp_web_page_sk#81]
Join type: Inner
Join condition: None

(77) Project [codegen id : 20]
Output [3]: [wr_return_amt#77, wr_net_loss#78, wp_web_page_sk#81]
Input [4]: [wr_web_page_sk#76, wr_return_amt#77, wr_net_loss#78, wp_web_page_sk#81]

(78) HashAggregate [codegen id : 20]
Input [3]: [wr_return_amt#77, wr_net_loss#78, wp_web_page_sk#81]
Keys [1]: [wp_web_page_sk#81]
Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#77)), partial_sum(UnscaledValue(wr_net_loss#78))]
Aggregate Attributes [2]: [sum#82, sum#83]
Results [3]: [wp_web_page_sk#81, sum#84, sum#85]

(79) Exchange
Input [3]: [wp_web_page_sk#81, sum#84, sum#85]
Arguments: hashpartitioning(wp_web_page_sk#81, 5), ENSURE_REQUIREMENTS, [plan_id=11]

(80) HashAggregate [codegen id : 21]
Input [3]: [wp_web_page_sk#81, sum#84, sum#85]
Keys [1]: [wp_web_page_sk#81]
Functions [2]: [sum(UnscaledValue(wr_return_amt#77)), sum(UnscaledValue(wr_net_loss#78))]
Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#77))#86, sum(UnscaledValue(wr_net_loss#78))#87]
Results [3]: [wp_web_page_sk#81, MakeDecimal(sum(UnscaledValue(wr_return_amt#77))#86,17,2) AS returns#88, MakeDecimal(sum(UnscaledValue(wr_net_loss#78))#87,17,2) AS profit_loss#89]

(81) BroadcastExchange
Input [3]: [wp_web_page_sk#81, returns#88, profit_loss#89]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=12]

(82) BroadcastHashJoin [codegen id : 22]
Left keys [1]: [wp_web_page_sk#67]
Right keys [1]: [wp_web_page_sk#81]
Join type: LeftOuter
Join condition: None

(83) Project [codegen id : 22]
Output [5]: [web channel AS channel#90, wp_web_page_sk#67 AS id#91, sales#74, coalesce(returns#88, 0.00) AS returns#92, (profit#75 - coalesce(profit_loss#89, 0.00)) AS profit#93]
Input [6]: [wp_web_page_sk#67, sales#74, profit#75, wp_web_page_sk#81, returns#88, profit_loss#89]

(84) Union

(85) HashAggregate [codegen id : 23]
Input [5]: [channel#30, id#31, sales#14, returns#32, profit#33]
Keys [2]: [channel#30, id#31]
Functions [3]: [partial_sum(sales#14), partial_sum(returns#32), partial_sum(profit#33)]
Aggregate Attributes [6]: [sum#94, isEmpty#95, sum#96, isEmpty#97, sum#98, isEmpty#99]
Results [8]: [channel#30, id#31, sum#100, isEmpty#101, sum#102, isEmpty#103, sum#104, isEmpty#105]

(86) Exchange
Input [8]: [channel#30, id#31, sum#100, isEmpty#101, sum#102, isEmpty#103, sum#104, isEmpty#105]
Arguments: hashpartitioning(channel#30, id#31, 5), ENSURE_REQUIREMENTS, [plan_id=13]

(87) HashAggregate [codegen id : 24]
Input [8]: [channel#30, id#31, sum#100, isEmpty#101, sum#102, isEmpty#103, sum#104, isEmpty#105]
Keys [2]: [channel#30, id#31]
Functions [3]: [sum(sales#14), sum(returns#32), sum(profit#33)]
Aggregate Attributes [3]: [sum(sales#14)#106, sum(returns#32)#107, sum(profit#33)#108]
Results [5]: [channel#30, id#31, cast(sum(sales#14)#106 as decimal(37,2)) AS sales#109, cast(sum(returns#32)#107 as decimal(37,2)) AS returns#110, cast(sum(profit#33)#108 as decimal(38,2)) AS profit#111]

(88) ReusedExchange [Reuses operator id: 86]
Output [8]: [channel#30, id#31, sum#100, isEmpty#101, sum#102, isEmpty#103, sum#104, isEmpty#105]

(89) HashAggregate [codegen id : 48]
Input [8]: [channel#30, id#31, sum#100, isEmpty#101, sum#102, isEmpty#103, sum#104, isEmpty#105]
Keys [2]: [channel#30, id#31]
Functions [3]: [sum(sales#14), sum(returns#32), sum(profit#33)]
Aggregate Attributes [3]: [sum(sales#14)#106, sum(returns#32)#107, sum(profit#33)#108]
Results [4]: [channel#30, sum(sales#14)#106 AS sales#112, sum(returns#32)#107 AS returns#113, sum(profit#33)#108 AS profit#114]

(90) HashAggregate [codegen id : 48]
Input [4]: [channel#30, sales#112, returns#113, profit#114]
Keys [1]: [channel#30]
Functions [3]: [partial_sum(sales#112), partial_sum(returns#113), partial_sum(profit#114)]
Aggregate Attributes [6]: [sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120]
Results [7]: [channel#30, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126]

(91) Exchange
Input [7]: [channel#30, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126]
Arguments: hashpartitioning(channel#30, 5), ENSURE_REQUIREMENTS, [plan_id=14]

(92) HashAggregate [codegen id : 49]
Input [7]: [channel#30, sum#121, isEmpty#122, sum#123, isEmpty#124, sum#125, isEmpty#126]
Keys [1]: [channel#30]
Functions [3]: [sum(sales#112), sum(returns#113), sum(profit#114)]
Aggregate Attributes [3]: [sum(sales#112)#127, sum(returns#113)#128, sum(profit#114)#129]
Results [5]: [channel#30, null AS id#130, sum(sales#112)#127 AS sales#131, sum(returns#113)#128 AS returns#132, sum(profit#114)#129 AS profit#133]

(93) ReusedExchange [Reuses operator id: 86]
Output [8]: [channel#30, id#31, sum#100, isEmpty#101, sum#102, isEmpty#103, sum#104, isEmpty#105]

(94) HashAggregate [codegen id : 73]
Input [8]: [channel#30, id#31, sum#100, isEmpty#101, sum#102, isEmpty#103, sum#104, isEmpty#105]
Keys [2]: [channel#30, id#31]
Functions [3]: [sum(sales#14), sum(returns#32), sum(profit#33)]
Aggregate Attributes [3]: [sum(sales#14)#106, sum(returns#32)#107, sum(profit#33)#108]
Results [3]: [sum(sales#14)#106 AS sales#112, sum(returns#32)#107 AS returns#113, sum(profit#33)#108 AS profit#114]

(95) HashAggregate [codegen id : 73]
Input [3]: [sales#112, returns#113, profit#114]
Keys: []
Functions [3]: [partial_sum(sales#112), partial_sum(returns#113), partial_sum(profit#114)]
Aggregate Attributes [6]: [sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139]
Results [6]: [sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145]

(96) Exchange
Input [6]: [sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=15]

(97) HashAggregate [codegen id : 74]
Input [6]: [sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145]
Keys: []
Functions [3]: [sum(sales#112), sum(returns#113), sum(profit#114)]
Aggregate Attributes [3]: [sum(sales#112)#146, sum(returns#113)#147, sum(profit#114)#148]
Results [5]: [null AS channel#149, null AS id#150, sum(sales#112)#146 AS sales#151, sum(returns#113)#147 AS returns#152, sum(profit#114)#148 AS profit#153]

(98) Union

(99) HashAggregate [codegen id : 75]
Input [5]: [channel#30, id#31, sales#109, returns#110, profit#111]
Keys [5]: [channel#30, id#31, sales#109, returns#110, profit#111]
Functions: []
Aggregate Attributes: []
Results [5]: [channel#30, id#31, sales#109, returns#110, profit#111]

(100) Exchange
Input [5]: [channel#30, id#31, sales#109, returns#110, profit#111]
Arguments: hashpartitioning(channel#30, id#31, sales#109, returns#110, profit#111, 5), ENSURE_REQUIREMENTS, [plan_id=16]

(101) HashAggregate [codegen id : 76]
Input [5]: [channel#30, id#31, sales#109, returns#110, profit#111]
Keys [5]: [channel#30, id#31, sales#109, returns#110, profit#111]
Functions: []
Aggregate Attributes: []
Results [5]: [channel#30, id#31, sales#109, returns#110, profit#111]

(102) TakeOrderedAndProject
Input [5]: [channel#30, id#31, sales#109, returns#110, profit#111]
Arguments: 100, [channel#30 ASC NULLS FIRST, id#31 ASC NULLS FIRST], [channel#30, id#31, sales#109, returns#110, profit#111]

