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


(1) Scan parquet 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 : 1]
Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4]

(3) Filter [codegen id : 1]
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) Project [codegen id : 1]
Output [6]: [ss_store_sk#1 AS store_sk#6, ss_sold_date_sk#4 AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11]
Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4]

(5) Scan parquet default.store_returns
Output [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(sr_returned_date_sk#15), dynamicpruningexpression(sr_returned_date_sk#15 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)>

(6) ColumnarToRow [codegen id : 2]
Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15]

(7) Filter [codegen id : 2]
Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15]
Condition : isnotnull(sr_store_sk#12)

(8) Project [codegen id : 2]
Output [6]: [sr_store_sk#12 AS store_sk#16, sr_returned_date_sk#15 AS date_sk#17, 0.00 AS sales_price#18, 0.00 AS profit#19, sr_return_amt#13 AS return_amt#20, sr_net_loss#14 AS net_loss#21]
Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15]

(9) Union

(10) Scan parquet default.store
Output [2]: [s_store_sk#22, s_store_id#23]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store]
PushedFilters: [IsNotNull(s_store_sk)]
ReadSchema: struct<s_store_sk:int,s_store_id:string>

(11) ColumnarToRow [codegen id : 3]
Input [2]: [s_store_sk#22, s_store_id#23]

(12) Filter [codegen id : 3]
Input [2]: [s_store_sk#22, s_store_id#23]
Condition : isnotnull(s_store_sk#22)

(13) BroadcastExchange
Input [2]: [s_store_sk#22, s_store_id#23]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24]

(14) BroadcastHashJoin [codegen id : 5]
Left keys [1]: [store_sk#6]
Right keys [1]: [s_store_sk#22]
Join condition: None

(15) Project [codegen id : 5]
Output [6]: [date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23]
Input [8]: [store_sk#6, date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_sk#22, s_store_id#23]

(16) ReusedExchange [Reuses operator id: 95]
Output [1]: [d_date_sk#25]

(17) BroadcastHashJoin [codegen id : 5]
Left keys [1]: [date_sk#7]
Right keys [1]: [d_date_sk#25]
Join condition: None

(18) Project [codegen id : 5]
Output [5]: [sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23]
Input [7]: [date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23, d_date_sk#25]

(19) HashAggregate [codegen id : 5]
Input [5]: [sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23]
Keys [1]: [s_store_id#23]
Functions [4]: [partial_sum(UnscaledValue(sales_price#8)), partial_sum(UnscaledValue(return_amt#10)), partial_sum(UnscaledValue(profit#9)), partial_sum(UnscaledValue(net_loss#11))]
Aggregate Attributes [4]: [sum#26, sum#27, sum#28, sum#29]
Results [5]: [s_store_id#23, sum#30, sum#31, sum#32, sum#33]

(20) Exchange
Input [5]: [s_store_id#23, sum#30, sum#31, sum#32, sum#33]
Arguments: hashpartitioning(s_store_id#23, 5), ENSURE_REQUIREMENTS, [id=#34]

(21) HashAggregate [codegen id : 6]
Input [5]: [s_store_id#23, sum#30, sum#31, sum#32, sum#33]
Keys [1]: [s_store_id#23]
Functions [4]: [sum(UnscaledValue(sales_price#8)), sum(UnscaledValue(return_amt#10)), sum(UnscaledValue(profit#9)), sum(UnscaledValue(net_loss#11))]
Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#8))#35, sum(UnscaledValue(return_amt#10))#36, sum(UnscaledValue(profit#9))#37, sum(UnscaledValue(net_loss#11))#38]
Results [5]: [store channel AS channel#39, concat(store, s_store_id#23) AS id#40, MakeDecimal(sum(UnscaledValue(sales_price#8))#35,17,2) AS sales#41, MakeDecimal(sum(UnscaledValue(return_amt#10))#36,17,2) AS returns#42, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#9))#37,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#11))#38,17,2) as decimal(18,2)))), DecimalType(18,2)) AS profit#43]

(22) Scan parquet default.catalog_sales
Output [4]: [cs_catalog_page_sk#44, cs_ext_sales_price#45, cs_net_profit#46, cs_sold_date_sk#47]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#47), dynamicpruningexpression(cs_sold_date_sk#47 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(cs_catalog_page_sk)]
ReadSchema: struct<cs_catalog_page_sk:int,cs_ext_sales_price:decimal(7,2),cs_net_profit:decimal(7,2)>

(23) ColumnarToRow [codegen id : 7]
Input [4]: [cs_catalog_page_sk#44, cs_ext_sales_price#45, cs_net_profit#46, cs_sold_date_sk#47]

(24) Filter [codegen id : 7]
Input [4]: [cs_catalog_page_sk#44, cs_ext_sales_price#45, cs_net_profit#46, cs_sold_date_sk#47]
Condition : isnotnull(cs_catalog_page_sk#44)

(25) Project [codegen id : 7]
Output [6]: [cs_catalog_page_sk#44 AS page_sk#48, cs_sold_date_sk#47 AS date_sk#49, cs_ext_sales_price#45 AS sales_price#50, cs_net_profit#46 AS profit#51, 0.00 AS return_amt#52, 0.00 AS net_loss#53]
Input [4]: [cs_catalog_page_sk#44, cs_ext_sales_price#45, cs_net_profit#46, cs_sold_date_sk#47]

(26) Scan parquet default.catalog_returns
Output [4]: [cr_catalog_page_sk#54, cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cr_returned_date_sk#57), dynamicpruningexpression(cr_returned_date_sk#57 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(cr_catalog_page_sk)]
ReadSchema: struct<cr_catalog_page_sk:int,cr_return_amount:decimal(7,2),cr_net_loss:decimal(7,2)>

(27) ColumnarToRow [codegen id : 8]
Input [4]: [cr_catalog_page_sk#54, cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57]

(28) Filter [codegen id : 8]
Input [4]: [cr_catalog_page_sk#54, cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57]
Condition : isnotnull(cr_catalog_page_sk#54)

(29) Project [codegen id : 8]
Output [6]: [cr_catalog_page_sk#54 AS page_sk#58, cr_returned_date_sk#57 AS date_sk#59, 0.00 AS sales_price#60, 0.00 AS profit#61, cr_return_amount#55 AS return_amt#62, cr_net_loss#56 AS net_loss#63]
Input [4]: [cr_catalog_page_sk#54, cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57]

(30) Union

(31) Scan parquet default.catalog_page
Output [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65]
Batched: true
Location [not included in comparison]/{warehouse_dir}/catalog_page]
PushedFilters: [IsNotNull(cp_catalog_page_sk)]
ReadSchema: struct<cp_catalog_page_sk:int,cp_catalog_page_id:string>

(32) ColumnarToRow [codegen id : 9]
Input [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65]

(33) Filter [codegen id : 9]
Input [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65]
Condition : isnotnull(cp_catalog_page_sk#64)

(34) BroadcastExchange
Input [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#66]

(35) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [page_sk#48]
Right keys [1]: [cp_catalog_page_sk#64]
Join condition: None

(36) Project [codegen id : 11]
Output [6]: [date_sk#49, sales_price#50, profit#51, return_amt#52, net_loss#53, cp_catalog_page_id#65]
Input [8]: [page_sk#48, date_sk#49, sales_price#50, profit#51, return_amt#52, net_loss#53, cp_catalog_page_sk#64, cp_catalog_page_id#65]

(37) ReusedExchange [Reuses operator id: 95]
Output [1]: [d_date_sk#67]

(38) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [date_sk#49]
Right keys [1]: [d_date_sk#67]
Join condition: None

(39) Project [codegen id : 11]
Output [5]: [sales_price#50, profit#51, return_amt#52, net_loss#53, cp_catalog_page_id#65]
Input [7]: [date_sk#49, sales_price#50, profit#51, return_amt#52, net_loss#53, cp_catalog_page_id#65, d_date_sk#67]

(40) HashAggregate [codegen id : 11]
Input [5]: [sales_price#50, profit#51, return_amt#52, net_loss#53, cp_catalog_page_id#65]
Keys [1]: [cp_catalog_page_id#65]
Functions [4]: [partial_sum(UnscaledValue(sales_price#50)), partial_sum(UnscaledValue(return_amt#52)), partial_sum(UnscaledValue(profit#51)), partial_sum(UnscaledValue(net_loss#53))]
Aggregate Attributes [4]: [sum#68, sum#69, sum#70, sum#71]
Results [5]: [cp_catalog_page_id#65, sum#72, sum#73, sum#74, sum#75]

(41) Exchange
Input [5]: [cp_catalog_page_id#65, sum#72, sum#73, sum#74, sum#75]
Arguments: hashpartitioning(cp_catalog_page_id#65, 5), ENSURE_REQUIREMENTS, [id=#76]

(42) HashAggregate [codegen id : 12]
Input [5]: [cp_catalog_page_id#65, sum#72, sum#73, sum#74, sum#75]
Keys [1]: [cp_catalog_page_id#65]
Functions [4]: [sum(UnscaledValue(sales_price#50)), sum(UnscaledValue(return_amt#52)), sum(UnscaledValue(profit#51)), sum(UnscaledValue(net_loss#53))]
Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#50))#77, sum(UnscaledValue(return_amt#52))#78, sum(UnscaledValue(profit#51))#79, sum(UnscaledValue(net_loss#53))#80]
Results [5]: [catalog channel AS channel#81, concat(catalog_page, cp_catalog_page_id#65) AS id#82, MakeDecimal(sum(UnscaledValue(sales_price#50))#77,17,2) AS sales#83, MakeDecimal(sum(UnscaledValue(return_amt#52))#78,17,2) AS returns#84, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#51))#79,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#53))#80,17,2) as decimal(18,2)))), DecimalType(18,2)) AS profit#85]

(43) Scan parquet default.web_sales
Output [4]: [ws_web_site_sk#86, ws_ext_sales_price#87, ws_net_profit#88, ws_sold_date_sk#89]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#89), dynamicpruningexpression(ws_sold_date_sk#89 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(ws_web_site_sk)]
ReadSchema: struct<ws_web_site_sk:int,ws_ext_sales_price:decimal(7,2),ws_net_profit:decimal(7,2)>

(44) ColumnarToRow [codegen id : 13]
Input [4]: [ws_web_site_sk#86, ws_ext_sales_price#87, ws_net_profit#88, ws_sold_date_sk#89]

(45) Filter [codegen id : 13]
Input [4]: [ws_web_site_sk#86, ws_ext_sales_price#87, ws_net_profit#88, ws_sold_date_sk#89]
Condition : isnotnull(ws_web_site_sk#86)

(46) Project [codegen id : 13]
Output [6]: [ws_web_site_sk#86 AS wsr_web_site_sk#90, ws_sold_date_sk#89 AS date_sk#91, ws_ext_sales_price#87 AS sales_price#92, ws_net_profit#88 AS profit#93, 0.00 AS return_amt#94, 0.00 AS net_loss#95]
Input [4]: [ws_web_site_sk#86, ws_ext_sales_price#87, ws_net_profit#88, ws_sold_date_sk#89]

(47) Scan parquet default.web_returns
Output [5]: [wr_item_sk#96, wr_order_number#97, wr_return_amt#98, wr_net_loss#99, wr_returned_date_sk#100]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(wr_returned_date_sk#100), dynamicpruningexpression(wr_returned_date_sk#100 IN dynamicpruning#5)]
ReadSchema: struct<wr_item_sk:int,wr_order_number:int,wr_return_amt:decimal(7,2),wr_net_loss:decimal(7,2)>

(48) ColumnarToRow [codegen id : 14]
Input [5]: [wr_item_sk#96, wr_order_number#97, wr_return_amt#98, wr_net_loss#99, wr_returned_date_sk#100]

(49) Exchange
Input [5]: [wr_item_sk#96, wr_order_number#97, wr_return_amt#98, wr_net_loss#99, wr_returned_date_sk#100]
Arguments: hashpartitioning(wr_item_sk#96, wr_order_number#97, 5), ENSURE_REQUIREMENTS, [id=#101]

(50) Sort [codegen id : 15]
Input [5]: [wr_item_sk#96, wr_order_number#97, wr_return_amt#98, wr_net_loss#99, wr_returned_date_sk#100]
Arguments: [wr_item_sk#96 ASC NULLS FIRST, wr_order_number#97 ASC NULLS FIRST], false, 0

(51) Scan parquet default.web_sales
Output [4]: [ws_item_sk#102, ws_web_site_sk#103, ws_order_number#104, ws_sold_date_sk#105]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_sales]
PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)]
ReadSchema: struct<ws_item_sk:int,ws_web_site_sk:int,ws_order_number:int>

(52) ColumnarToRow [codegen id : 16]
Input [4]: [ws_item_sk#102, ws_web_site_sk#103, ws_order_number#104, ws_sold_date_sk#105]

(53) Filter [codegen id : 16]
Input [4]: [ws_item_sk#102, ws_web_site_sk#103, ws_order_number#104, ws_sold_date_sk#105]
Condition : ((isnotnull(ws_item_sk#102) AND isnotnull(ws_order_number#104)) AND isnotnull(ws_web_site_sk#103))

(54) Project [codegen id : 16]
Output [3]: [ws_item_sk#102, ws_web_site_sk#103, ws_order_number#104]
Input [4]: [ws_item_sk#102, ws_web_site_sk#103, ws_order_number#104, ws_sold_date_sk#105]

(55) Exchange
Input [3]: [ws_item_sk#102, ws_web_site_sk#103, ws_order_number#104]
Arguments: hashpartitioning(ws_item_sk#102, ws_order_number#104, 5), ENSURE_REQUIREMENTS, [id=#106]

(56) Sort [codegen id : 17]
Input [3]: [ws_item_sk#102, ws_web_site_sk#103, ws_order_number#104]
Arguments: [ws_item_sk#102 ASC NULLS FIRST, ws_order_number#104 ASC NULLS FIRST], false, 0

(57) SortMergeJoin [codegen id : 18]
Left keys [2]: [wr_item_sk#96, wr_order_number#97]
Right keys [2]: [ws_item_sk#102, ws_order_number#104]
Join condition: None

(58) Project [codegen id : 18]
Output [6]: [ws_web_site_sk#103 AS wsr_web_site_sk#107, wr_returned_date_sk#100 AS date_sk#108, 0.00 AS sales_price#109, 0.00 AS profit#110, wr_return_amt#98 AS return_amt#111, wr_net_loss#99 AS net_loss#112]
Input [8]: [wr_item_sk#96, wr_order_number#97, wr_return_amt#98, wr_net_loss#99, wr_returned_date_sk#100, ws_item_sk#102, ws_web_site_sk#103, ws_order_number#104]

(59) Union

(60) Scan parquet default.web_site
Output [2]: [web_site_sk#113, web_site_id#114]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_site]
PushedFilters: [IsNotNull(web_site_sk)]
ReadSchema: struct<web_site_sk:int,web_site_id:string>

(61) ColumnarToRow [codegen id : 19]
Input [2]: [web_site_sk#113, web_site_id#114]

(62) Filter [codegen id : 19]
Input [2]: [web_site_sk#113, web_site_id#114]
Condition : isnotnull(web_site_sk#113)

(63) BroadcastExchange
Input [2]: [web_site_sk#113, web_site_id#114]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#115]

(64) BroadcastHashJoin [codegen id : 21]
Left keys [1]: [wsr_web_site_sk#90]
Right keys [1]: [web_site_sk#113]
Join condition: None

(65) Project [codegen id : 21]
Output [6]: [date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#114]
Input [8]: [wsr_web_site_sk#90, date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_sk#113, web_site_id#114]

(66) ReusedExchange [Reuses operator id: 95]
Output [1]: [d_date_sk#116]

(67) BroadcastHashJoin [codegen id : 21]
Left keys [1]: [date_sk#91]
Right keys [1]: [d_date_sk#116]
Join condition: None

(68) Project [codegen id : 21]
Output [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#114]
Input [7]: [date_sk#91, sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#114, d_date_sk#116]

(69) HashAggregate [codegen id : 21]
Input [5]: [sales_price#92, profit#93, return_amt#94, net_loss#95, web_site_id#114]
Keys [1]: [web_site_id#114]
Functions [4]: [partial_sum(UnscaledValue(sales_price#92)), partial_sum(UnscaledValue(return_amt#94)), partial_sum(UnscaledValue(profit#93)), partial_sum(UnscaledValue(net_loss#95))]
Aggregate Attributes [4]: [sum#117, sum#118, sum#119, sum#120]
Results [5]: [web_site_id#114, sum#121, sum#122, sum#123, sum#124]

(70) Exchange
Input [5]: [web_site_id#114, sum#121, sum#122, sum#123, sum#124]
Arguments: hashpartitioning(web_site_id#114, 5), ENSURE_REQUIREMENTS, [id=#125]

(71) HashAggregate [codegen id : 22]
Input [5]: [web_site_id#114, sum#121, sum#122, sum#123, sum#124]
Keys [1]: [web_site_id#114]
Functions [4]: [sum(UnscaledValue(sales_price#92)), sum(UnscaledValue(return_amt#94)), sum(UnscaledValue(profit#93)), sum(UnscaledValue(net_loss#95))]
Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#92))#126, sum(UnscaledValue(return_amt#94))#127, sum(UnscaledValue(profit#93))#128, sum(UnscaledValue(net_loss#95))#129]
Results [5]: [web channel AS channel#130, concat(web_site, web_site_id#114) AS id#131, MakeDecimal(sum(UnscaledValue(sales_price#92))#126,17,2) AS sales#132, MakeDecimal(sum(UnscaledValue(return_amt#94))#127,17,2) AS returns#133, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#93))#128,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#95))#129,17,2) as decimal(18,2)))), DecimalType(18,2)) AS profit#134]

(72) Union

(73) HashAggregate [codegen id : 23]
Input [5]: [channel#39, id#40, sales#41, returns#42, profit#43]
Keys [2]: [channel#39, id#40]
Functions [3]: [partial_sum(sales#41), partial_sum(returns#42), partial_sum(profit#43)]
Aggregate Attributes [6]: [sum#135, isEmpty#136, sum#137, isEmpty#138, sum#139, isEmpty#140]
Results [8]: [channel#39, id#40, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146]

(74) Exchange
Input [8]: [channel#39, id#40, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146]
Arguments: hashpartitioning(channel#39, id#40, 5), ENSURE_REQUIREMENTS, [id=#147]

(75) HashAggregate [codegen id : 24]
Input [8]: [channel#39, id#40, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146]
Keys [2]: [channel#39, id#40]
Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)]
Aggregate Attributes [3]: [sum(sales#41)#148, sum(returns#42)#149, sum(profit#43)#150]
Results [5]: [channel#39, id#40, cast(sum(sales#41)#148 as decimal(37,2)) AS sales#151, cast(sum(returns#42)#149 as decimal(37,2)) AS returns#152, cast(sum(profit#43)#150 as decimal(38,2)) AS profit#153]

(76) ReusedExchange [Reuses operator id: 74]
Output [8]: [channel#39, id#40, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146]

(77) HashAggregate [codegen id : 48]
Input [8]: [channel#39, id#40, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146]
Keys [2]: [channel#39, id#40]
Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)]
Aggregate Attributes [3]: [sum(sales#41)#148, sum(returns#42)#149, sum(profit#43)#150]
Results [4]: [channel#39, sum(sales#41)#148 AS sales#154, sum(returns#42)#149 AS returns#155, sum(profit#43)#150 AS profit#156]

(78) HashAggregate [codegen id : 48]
Input [4]: [channel#39, sales#154, returns#155, profit#156]
Keys [1]: [channel#39]
Functions [3]: [partial_sum(sales#154), partial_sum(returns#155), partial_sum(profit#156)]
Aggregate Attributes [6]: [sum#157, isEmpty#158, sum#159, isEmpty#160, sum#161, isEmpty#162]
Results [7]: [channel#39, sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168]

(79) Exchange
Input [7]: [channel#39, sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168]
Arguments: hashpartitioning(channel#39, 5), ENSURE_REQUIREMENTS, [id=#169]

(80) HashAggregate [codegen id : 49]
Input [7]: [channel#39, sum#163, isEmpty#164, sum#165, isEmpty#166, sum#167, isEmpty#168]
Keys [1]: [channel#39]
Functions [3]: [sum(sales#154), sum(returns#155), sum(profit#156)]
Aggregate Attributes [3]: [sum(sales#154)#170, sum(returns#155)#171, sum(profit#156)#172]
Results [5]: [channel#39, null AS id#173, sum(sales#154)#170 AS sum(sales)#174, sum(returns#155)#171 AS sum(returns)#175, sum(profit#156)#172 AS sum(profit)#176]

(81) ReusedExchange [Reuses operator id: 74]
Output [8]: [channel#39, id#40, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146]

(82) HashAggregate [codegen id : 73]
Input [8]: [channel#39, id#40, sum#141, isEmpty#142, sum#143, isEmpty#144, sum#145, isEmpty#146]
Keys [2]: [channel#39, id#40]
Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)]
Aggregate Attributes [3]: [sum(sales#41)#148, sum(returns#42)#149, sum(profit#43)#150]
Results [3]: [sum(sales#41)#148 AS sales#154, sum(returns#42)#149 AS returns#155, sum(profit#43)#150 AS profit#156]

(83) HashAggregate [codegen id : 73]
Input [3]: [sales#154, returns#155, profit#156]
Keys: []
Functions [3]: [partial_sum(sales#154), partial_sum(returns#155), partial_sum(profit#156)]
Aggregate Attributes [6]: [sum#177, isEmpty#178, sum#179, isEmpty#180, sum#181, isEmpty#182]
Results [6]: [sum#183, isEmpty#184, sum#185, isEmpty#186, sum#187, isEmpty#188]

(84) Exchange
Input [6]: [sum#183, isEmpty#184, sum#185, isEmpty#186, sum#187, isEmpty#188]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#189]

(85) HashAggregate [codegen id : 74]
Input [6]: [sum#183, isEmpty#184, sum#185, isEmpty#186, sum#187, isEmpty#188]
Keys: []
Functions [3]: [sum(sales#154), sum(returns#155), sum(profit#156)]
Aggregate Attributes [3]: [sum(sales#154)#190, sum(returns#155)#191, sum(profit#156)#192]
Results [5]: [null AS channel#193, null AS id#194, sum(sales#154)#190 AS sum(sales)#195, sum(returns#155)#191 AS sum(returns)#196, sum(profit#156)#192 AS sum(profit)#197]

(86) Union

(87) HashAggregate [codegen id : 75]
Input [5]: [channel#39, id#40, sales#151, returns#152, profit#153]
Keys [5]: [channel#39, id#40, sales#151, returns#152, profit#153]
Functions: []
Aggregate Attributes: []
Results [5]: [channel#39, id#40, sales#151, returns#152, profit#153]

(88) Exchange
Input [5]: [channel#39, id#40, sales#151, returns#152, profit#153]
Arguments: hashpartitioning(channel#39, id#40, sales#151, returns#152, profit#153, 5), ENSURE_REQUIREMENTS, [id=#198]

(89) HashAggregate [codegen id : 76]
Input [5]: [channel#39, id#40, sales#151, returns#152, profit#153]
Keys [5]: [channel#39, id#40, sales#151, returns#152, profit#153]
Functions: []
Aggregate Attributes: []
Results [5]: [channel#39, id#40, sales#151, returns#152, profit#153]

(90) TakeOrderedAndProject
Input [5]: [channel#39, id#40, sales#151, returns#152, profit#153]
Arguments: 100, [channel#39 ASC NULLS FIRST, id#40 ASC NULLS FIRST], [channel#39, id#40, sales#151, returns#152, profit#153]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5
BroadcastExchange (95)
+- * Project (94)
   +- * Filter (93)
      +- * ColumnarToRow (92)
         +- Scan parquet default.date_dim (91)


(91) Scan parquet default.date_dim
Output [2]: [d_date_sk#25, d_date#199]
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-08-18), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date>

(92) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#25, d_date#199]

(93) Filter [codegen id : 1]
Input [2]: [d_date_sk#25, d_date#199]
Condition : (((isnotnull(d_date#199) AND (d_date#199 >= 1998-08-04)) AND (d_date#199 <= 1998-08-18)) AND isnotnull(d_date_sk#25))

(94) Project [codegen id : 1]
Output [1]: [d_date_sk#25]
Input [2]: [d_date_sk#25, d_date#199]

(95) BroadcastExchange
Input [1]: [d_date_sk#25]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#200]

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

Subquery:3 Hosting operator id = 22 Hosting Expression = cs_sold_date_sk#47 IN dynamicpruning#5

Subquery:4 Hosting operator id = 26 Hosting Expression = cr_returned_date_sk#57 IN dynamicpruning#5

Subquery:5 Hosting operator id = 43 Hosting Expression = ws_sold_date_sk#89 IN dynamicpruning#5

Subquery:6 Hosting operator id = 47 Hosting Expression = wr_returned_date_sk#100 IN dynamicpruning#5


