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


(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), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)]
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) ReusedExchange [Reuses operator id: 134]
Output [1]: [d_date_sk#6]

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

(6) 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#6]

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

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

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

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

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

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

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

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

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

(16) 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), dynamicpruningexpression(sr_returned_date_sk#19 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(sr_store_sk)]
ReadSchema: struct<sr_store_sk:int,sr_return_amt:decimal(7,2),sr_net_loss:decimal(7,2)>

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

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

(19) ReusedExchange [Reuses operator id: 134]
Output [1]: [d_date_sk#20]

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

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

(22) ReusedExchange [Reuses operator id: 10]
Output [1]: [s_store_sk#21]

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

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

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

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

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

(28) 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=4]

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

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

(31) 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), dynamicpruningexpression(cs_sold_date_sk#37 IN dynamicpruning#5)]
ReadSchema: struct<cs_call_center_sk:int,cs_ext_sales_price:decimal(7,2),cs_net_profit:decimal(7,2)>

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

(33) ReusedExchange [Reuses operator id: 134]
Output [1]: [d_date_sk#38]

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

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

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

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

(38) HashAggregate [codegen id : 14]
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]

(39) 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), dynamicpruningexpression(cr_returned_date_sk#49 IN dynamicpruning#5)]
ReadSchema: struct<cr_return_amount:decimal(7,2),cr_net_loss:decimal(7,2)>

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

(41) ReusedExchange [Reuses operator id: 134]
Output [1]: [d_date_sk#50]

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

(43) Project [codegen id : 12]
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]

(44) HashAggregate [codegen id : 12]
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]

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

(46) HashAggregate [codegen id : 13]
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]

(47) BroadcastExchange
Input [2]: [returns#57, profit_loss#58]
Arguments: IdentityBroadcastMode, [plan_id=7]

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

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

(50) 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), dynamicpruningexpression(ws_sold_date_sk#65 IN dynamicpruning#5)]
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)>

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

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

(53) ReusedExchange [Reuses operator id: 134]
Output [1]: [d_date_sk#66]

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

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

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

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

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

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

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

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

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

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

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

(65) 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), dynamicpruningexpression(wr_returned_date_sk#79 IN dynamicpruning#5)]
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)>

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

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

(68) ReusedExchange [Reuses operator id: 134]
Output [1]: [d_date_sk#80]

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

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

(71) ReusedExchange [Reuses operator id: 59]
Output [1]: [wp_web_page_sk#81]

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

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

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

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

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

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

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

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

(80) Union

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

(82) HashAggregate [codegen id : 23]
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]

(83) ReusedExchange [Reuses operator id: 14]
Output [3]: [s_store_sk#112, sum#113, sum#114]

(84) HashAggregate [codegen id : 31]
Input [3]: [s_store_sk#112, sum#113, sum#114]
Keys [1]: [s_store_sk#112]
Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#115)), sum(UnscaledValue(ss_net_profit#116))]
Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#115))#12, sum(UnscaledValue(ss_net_profit#116))#13]
Results [3]: [s_store_sk#112, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#115))#12,17,2) AS sales#117, MakeDecimal(sum(UnscaledValue(ss_net_profit#116))#13,17,2) AS profit#118]

(85) ReusedExchange [Reuses operator id: 28]
Output [3]: [s_store_sk#119, returns#120, profit_loss#121]

(86) BroadcastHashJoin [codegen id : 31]
Left keys [1]: [s_store_sk#112]
Right keys [1]: [s_store_sk#119]
Join type: LeftOuter
Join condition: None

(87) Project [codegen id : 31]
Output [5]: [store channel AS channel#122, s_store_sk#112 AS id#123, sales#117, coalesce(returns#120, 0.00) AS returns#124, (profit#118 - coalesce(profit_loss#121, 0.00)) AS profit#125]
Input [6]: [s_store_sk#112, sales#117, profit#118, s_store_sk#119, returns#120, profit_loss#121]

(88) ReusedExchange [Reuses operator id: 37]
Output [3]: [cs_call_center_sk#126, sum#127, sum#128]

(89) HashAggregate [codegen id : 37]
Input [3]: [cs_call_center_sk#126, sum#127, sum#128]
Keys [1]: [cs_call_center_sk#126]
Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#129)), sum(UnscaledValue(cs_net_profit#130))]
Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#129))#43, sum(UnscaledValue(cs_net_profit#130))#44]
Results [3]: [cs_call_center_sk#126, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#129))#43,17,2) AS sales#131, MakeDecimal(sum(UnscaledValue(cs_net_profit#130))#44,17,2) AS profit#132]

(90) ReusedExchange [Reuses operator id: 47]
Output [2]: [returns#133, profit_loss#134]

(91) BroadcastNestedLoopJoin [codegen id : 37]
Join type: Inner
Join condition: None

(92) Project [codegen id : 37]
Output [5]: [catalog channel AS channel#135, cs_call_center_sk#126 AS id#136, sales#131, returns#133, (profit#132 - profit_loss#134) AS profit#137]
Input [5]: [cs_call_center_sk#126, sales#131, profit#132, returns#133, profit_loss#134]

(93) ReusedExchange [Reuses operator id: 63]
Output [3]: [wp_web_page_sk#138, sum#139, sum#140]

(94) HashAggregate [codegen id : 45]
Input [3]: [wp_web_page_sk#138, sum#139, sum#140]
Keys [1]: [wp_web_page_sk#138]
Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#141)), sum(UnscaledValue(ws_net_profit#142))]
Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#141))#72, sum(UnscaledValue(ws_net_profit#142))#73]
Results [3]: [wp_web_page_sk#138, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#141))#72,17,2) AS sales#143, MakeDecimal(sum(UnscaledValue(ws_net_profit#142))#73,17,2) AS profit#144]

(95) ReusedExchange [Reuses operator id: 77]
Output [3]: [wp_web_page_sk#145, returns#146, profit_loss#147]

(96) BroadcastHashJoin [codegen id : 45]
Left keys [1]: [wp_web_page_sk#138]
Right keys [1]: [wp_web_page_sk#145]
Join type: LeftOuter
Join condition: None

(97) Project [codegen id : 45]
Output [5]: [web channel AS channel#148, wp_web_page_sk#138 AS id#149, sales#143, coalesce(returns#146, 0.00) AS returns#150, (profit#144 - coalesce(profit_loss#147, 0.00)) AS profit#151]
Input [6]: [wp_web_page_sk#138, sales#143, profit#144, wp_web_page_sk#145, returns#146, profit_loss#147]

(98) Union

(99) HashAggregate [codegen id : 46]
Input [5]: [channel#122, id#123, sales#117, returns#124, profit#125]
Keys [2]: [channel#122, id#123]
Functions [3]: [partial_sum(sales#117), partial_sum(returns#124), partial_sum(profit#125)]
Aggregate Attributes [6]: [sum#152, isEmpty#153, sum#154, isEmpty#155, sum#156, isEmpty#157]
Results [8]: [channel#122, id#123, sum#158, isEmpty#159, sum#160, isEmpty#161, sum#162, isEmpty#163]

(100) HashAggregate [codegen id : 46]
Input [8]: [channel#122, id#123, sum#158, isEmpty#159, sum#160, isEmpty#161, sum#162, isEmpty#163]
Keys [2]: [channel#122, id#123]
Functions [3]: [sum(sales#117), sum(returns#124), sum(profit#125)]
Aggregate Attributes [3]: [sum(sales#117)#106, sum(returns#124)#107, sum(profit#125)#108]
Results [4]: [channel#122, sum(sales#117)#106 AS sales#164, sum(returns#124)#107 AS returns#165, sum(profit#125)#108 AS profit#166]

(101) HashAggregate [codegen id : 46]
Input [4]: [channel#122, sales#164, returns#165, profit#166]
Keys [1]: [channel#122]
Functions [3]: [partial_sum(sales#164), partial_sum(returns#165), partial_sum(profit#166)]
Aggregate Attributes [6]: [sum#167, isEmpty#168, sum#169, isEmpty#170, sum#171, isEmpty#172]
Results [7]: [channel#122, sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178]

(102) Exchange
Input [7]: [channel#122, sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178]
Arguments: hashpartitioning(channel#122, 5), ENSURE_REQUIREMENTS, [plan_id=12]

(103) HashAggregate [codegen id : 47]
Input [7]: [channel#122, sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178]
Keys [1]: [channel#122]
Functions [3]: [sum(sales#164), sum(returns#165), sum(profit#166)]
Aggregate Attributes [3]: [sum(sales#164)#179, sum(returns#165)#180, sum(profit#166)#181]
Results [5]: [channel#122, null AS id#182, sum(sales#164)#179 AS sales#183, sum(returns#165)#180 AS returns#184, sum(profit#166)#181 AS profit#185]

(104) ReusedExchange [Reuses operator id: 14]
Output [3]: [s_store_sk#186, sum#187, sum#188]

(105) HashAggregate [codegen id : 55]
Input [3]: [s_store_sk#186, sum#187, sum#188]
Keys [1]: [s_store_sk#186]
Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#189)), sum(UnscaledValue(ss_net_profit#190))]
Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#189))#12, sum(UnscaledValue(ss_net_profit#190))#13]
Results [3]: [s_store_sk#186, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#189))#12,17,2) AS sales#191, MakeDecimal(sum(UnscaledValue(ss_net_profit#190))#13,17,2) AS profit#192]

(106) ReusedExchange [Reuses operator id: 28]
Output [3]: [s_store_sk#193, returns#194, profit_loss#195]

(107) BroadcastHashJoin [codegen id : 55]
Left keys [1]: [s_store_sk#186]
Right keys [1]: [s_store_sk#193]
Join type: LeftOuter
Join condition: None

(108) Project [codegen id : 55]
Output [5]: [store channel AS channel#196, s_store_sk#186 AS id#197, sales#191, coalesce(returns#194, 0.00) AS returns#198, (profit#192 - coalesce(profit_loss#195, 0.00)) AS profit#199]
Input [6]: [s_store_sk#186, sales#191, profit#192, s_store_sk#193, returns#194, profit_loss#195]

(109) ReusedExchange [Reuses operator id: 37]
Output [3]: [cs_call_center_sk#200, sum#201, sum#202]

(110) HashAggregate [codegen id : 61]
Input [3]: [cs_call_center_sk#200, sum#201, sum#202]
Keys [1]: [cs_call_center_sk#200]
Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#203)), sum(UnscaledValue(cs_net_profit#204))]
Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#203))#43, sum(UnscaledValue(cs_net_profit#204))#44]
Results [3]: [cs_call_center_sk#200, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#203))#43,17,2) AS sales#205, MakeDecimal(sum(UnscaledValue(cs_net_profit#204))#44,17,2) AS profit#206]

(111) ReusedExchange [Reuses operator id: 47]
Output [2]: [returns#207, profit_loss#208]

(112) BroadcastNestedLoopJoin [codegen id : 61]
Join type: Inner
Join condition: None

(113) Project [codegen id : 61]
Output [5]: [catalog channel AS channel#209, cs_call_center_sk#200 AS id#210, sales#205, returns#207, (profit#206 - profit_loss#208) AS profit#211]
Input [5]: [cs_call_center_sk#200, sales#205, profit#206, returns#207, profit_loss#208]

(114) ReusedExchange [Reuses operator id: 63]
Output [3]: [wp_web_page_sk#212, sum#213, sum#214]

(115) HashAggregate [codegen id : 69]
Input [3]: [wp_web_page_sk#212, sum#213, sum#214]
Keys [1]: [wp_web_page_sk#212]
Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#215)), sum(UnscaledValue(ws_net_profit#216))]
Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#215))#72, sum(UnscaledValue(ws_net_profit#216))#73]
Results [3]: [wp_web_page_sk#212, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#215))#72,17,2) AS sales#217, MakeDecimal(sum(UnscaledValue(ws_net_profit#216))#73,17,2) AS profit#218]

(116) ReusedExchange [Reuses operator id: 77]
Output [3]: [wp_web_page_sk#219, returns#220, profit_loss#221]

(117) BroadcastHashJoin [codegen id : 69]
Left keys [1]: [wp_web_page_sk#212]
Right keys [1]: [wp_web_page_sk#219]
Join type: LeftOuter
Join condition: None

(118) Project [codegen id : 69]
Output [5]: [web channel AS channel#222, wp_web_page_sk#212 AS id#223, sales#217, coalesce(returns#220, 0.00) AS returns#224, (profit#218 - coalesce(profit_loss#221, 0.00)) AS profit#225]
Input [6]: [wp_web_page_sk#212, sales#217, profit#218, wp_web_page_sk#219, returns#220, profit_loss#221]

(119) Union

(120) HashAggregate [codegen id : 70]
Input [5]: [channel#196, id#197, sales#191, returns#198, profit#199]
Keys [2]: [channel#196, id#197]
Functions [3]: [partial_sum(sales#191), partial_sum(returns#198), partial_sum(profit#199)]
Aggregate Attributes [6]: [sum#226, isEmpty#227, sum#228, isEmpty#229, sum#230, isEmpty#231]
Results [8]: [channel#196, id#197, sum#232, isEmpty#233, sum#234, isEmpty#235, sum#236, isEmpty#237]

(121) HashAggregate [codegen id : 70]
Input [8]: [channel#196, id#197, sum#232, isEmpty#233, sum#234, isEmpty#235, sum#236, isEmpty#237]
Keys [2]: [channel#196, id#197]
Functions [3]: [sum(sales#191), sum(returns#198), sum(profit#199)]
Aggregate Attributes [3]: [sum(sales#191)#106, sum(returns#198)#107, sum(profit#199)#108]
Results [3]: [sum(sales#191)#106 AS sales#238, sum(returns#198)#107 AS returns#239, sum(profit#199)#108 AS profit#240]

(122) HashAggregate [codegen id : 70]
Input [3]: [sales#238, returns#239, profit#240]
Keys: []
Functions [3]: [partial_sum(sales#238), partial_sum(returns#239), partial_sum(profit#240)]
Aggregate Attributes [6]: [sum#241, isEmpty#242, sum#243, isEmpty#244, sum#245, isEmpty#246]
Results [6]: [sum#247, isEmpty#248, sum#249, isEmpty#250, sum#251, isEmpty#252]

(123) Exchange
Input [6]: [sum#247, isEmpty#248, sum#249, isEmpty#250, sum#251, isEmpty#252]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=13]

(124) HashAggregate [codegen id : 71]
Input [6]: [sum#247, isEmpty#248, sum#249, isEmpty#250, sum#251, isEmpty#252]
Keys: []
Functions [3]: [sum(sales#238), sum(returns#239), sum(profit#240)]
Aggregate Attributes [3]: [sum(sales#238)#253, sum(returns#239)#254, sum(profit#240)#255]
Results [5]: [null AS channel#256, null AS id#257, sum(sales#238)#253 AS sales#258, sum(returns#239)#254 AS returns#259, sum(profit#240)#255 AS profit#260]

(125) Union

(126) HashAggregate [codegen id : 72]
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]

(127) 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=14]

(128) HashAggregate [codegen id : 73]
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]

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

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5
BroadcastExchange (134)
+- * Project (133)
   +- * Filter (132)
      +- * ColumnarToRow (131)
         +- Scan parquet spark_catalog.default.date_dim (130)


(130) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#6, d_date#261]
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>

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

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

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

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

Subquery:2 Hosting operator id = 16 Hosting Expression = sr_returned_date_sk#19 IN dynamicpruning#5

Subquery:3 Hosting operator id = 31 Hosting Expression = cs_sold_date_sk#37 IN dynamicpruning#5

Subquery:4 Hosting operator id = 39 Hosting Expression = cr_returned_date_sk#49 IN dynamicpruning#5

Subquery:5 Hosting operator id = 50 Hosting Expression = ws_sold_date_sk#65 IN dynamicpruning#5

Subquery:6 Hosting operator id = 65 Hosting Expression = wr_returned_date_sk#79 IN dynamicpruning#5


