== Physical Plan ==
* Sort (47)
+- * HashAggregate (46)
   +- Exchange (45)
      +- * HashAggregate (44)
         +- * HashAggregate (43)
            +- Exchange (42)
               +- * HashAggregate (41)
                  +- * Project (40)
                     +- * BroadcastHashJoin Inner BuildRight (39)
                        :- * Project (33)
                        :  +- * BroadcastHashJoin Inner BuildRight (32)
                        :     :- * Project (26)
                        :     :  +- * BroadcastHashJoin Inner BuildRight (25)
                        :     :     :- SortMergeJoin LeftAnti (19)
                        :     :     :  :- * Sort (14)
                        :     :     :  :  +- Exchange (13)
                        :     :     :  :     +- * Project (12)
                        :     :     :  :        +- SortMergeJoin LeftSemi (11)
                        :     :     :  :           :- * Sort (5)
                        :     :     :  :           :  +- Exchange (4)
                        :     :     :  :           :     +- * Filter (3)
                        :     :     :  :           :        +- * ColumnarToRow (2)
                        :     :     :  :           :           +- Scan parquet default.web_sales (1)
                        :     :     :  :           +- * Sort (10)
                        :     :     :  :              +- Exchange (9)
                        :     :     :  :                 +- * Project (8)
                        :     :     :  :                    +- * ColumnarToRow (7)
                        :     :     :  :                       +- Scan parquet default.web_sales (6)
                        :     :     :  +- * Sort (18)
                        :     :     :     +- Exchange (17)
                        :     :     :        +- * ColumnarToRow (16)
                        :     :     :           +- Scan parquet default.web_returns (15)
                        :     :     +- BroadcastExchange (24)
                        :     :        +- * Project (23)
                        :     :           +- * Filter (22)
                        :     :              +- * ColumnarToRow (21)
                        :     :                 +- Scan parquet default.customer_address (20)
                        :     +- BroadcastExchange (31)
                        :        +- * Project (30)
                        :           +- * Filter (29)
                        :              +- * ColumnarToRow (28)
                        :                 +- Scan parquet default.web_site (27)
                        +- BroadcastExchange (38)
                           +- * Project (37)
                              +- * Filter (36)
                                 +- * ColumnarToRow (35)
                                    +- Scan parquet default.date_dim (34)


(1) Scan parquet default.web_sales
Output [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_sales]
PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)]
ReadSchema: struct<ws_ship_date_sk:int,ws_ship_addr_sk:int,ws_web_site_sk:int,ws_warehouse_sk:int,ws_order_number:int,ws_ext_ship_cost:decimal(7,2),ws_net_profit:decimal(7,2)>

(2) ColumnarToRow [codegen id : 1]
Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]

(3) Filter [codegen id : 1]
Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Condition : ((isnotnull(ws_ship_date_sk#1) AND isnotnull(ws_ship_addr_sk#2)) AND isnotnull(ws_web_site_sk#3))

(4) Exchange
Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Arguments: hashpartitioning(ws_order_number#5, 5), true, [id=#8]

(5) Sort [codegen id : 2]
Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Arguments: [ws_order_number#5 ASC NULLS FIRST], false, 0

(6) Scan parquet default.web_sales
Output [2]: [ws_warehouse_sk#4, ws_order_number#5]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_sales]
ReadSchema: struct<ws_warehouse_sk:int,ws_order_number:int>

(7) ColumnarToRow [codegen id : 3]
Input [2]: [ws_warehouse_sk#4, ws_order_number#5]

(8) Project [codegen id : 3]
Output [2]: [ws_warehouse_sk#4 AS ws_warehouse_sk#4#9, ws_order_number#5 AS ws_order_number#5#10]
Input [2]: [ws_warehouse_sk#4, ws_order_number#5]

(9) Exchange
Input [2]: [ws_warehouse_sk#4#9, ws_order_number#5#10]
Arguments: hashpartitioning(ws_order_number#5#10, 5), true, [id=#11]

(10) Sort [codegen id : 4]
Input [2]: [ws_warehouse_sk#4#9, ws_order_number#5#10]
Arguments: [ws_order_number#5#10 ASC NULLS FIRST], false, 0

(11) SortMergeJoin
Left keys [1]: [ws_order_number#5]
Right keys [1]: [ws_order_number#5#10]
Join condition: NOT (ws_warehouse_sk#4 = ws_warehouse_sk#4#9)

(12) Project [codegen id : 5]
Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]

(13) Exchange
Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Arguments: hashpartitioning(cast(ws_order_number#5 as bigint), 5), true, [id=#12]

(14) Sort [codegen id : 6]
Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Arguments: [cast(ws_order_number#5 as bigint) ASC NULLS FIRST], false, 0

(15) Scan parquet default.web_returns
Output [1]: [wr_order_number#13]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_returns]
ReadSchema: struct<wr_order_number:bigint>

(16) ColumnarToRow [codegen id : 7]
Input [1]: [wr_order_number#13]

(17) Exchange
Input [1]: [wr_order_number#13]
Arguments: hashpartitioning(wr_order_number#13, 5), true, [id=#14]

(18) Sort [codegen id : 8]
Input [1]: [wr_order_number#13]
Arguments: [wr_order_number#13 ASC NULLS FIRST], false, 0

(19) SortMergeJoin
Left keys [1]: [cast(ws_order_number#5 as bigint)]
Right keys [1]: [wr_order_number#13]
Join condition: None

(20) Scan parquet default.customer_address
Output [2]: [ca_address_sk#15, ca_state#16]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string>

(21) ColumnarToRow [codegen id : 9]
Input [2]: [ca_address_sk#15, ca_state#16]

(22) Filter [codegen id : 9]
Input [2]: [ca_address_sk#15, ca_state#16]
Condition : ((isnotnull(ca_state#16) AND (ca_state#16 = IL)) AND isnotnull(ca_address_sk#15))

(23) Project [codegen id : 9]
Output [1]: [ca_address_sk#15]
Input [2]: [ca_address_sk#15, ca_state#16]

(24) BroadcastExchange
Input [1]: [ca_address_sk#15]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17]

(25) BroadcastHashJoin [codegen id : 12]
Left keys [1]: [ws_ship_addr_sk#2]
Right keys [1]: [ca_address_sk#15]
Join condition: None

(26) Project [codegen id : 12]
Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#15]

(27) Scan parquet default.web_site
Output [2]: [web_site_sk#18, web_company_name#19]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_site]
PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri), IsNotNull(web_site_sk)]
ReadSchema: struct<web_site_sk:int,web_company_name:string>

(28) ColumnarToRow [codegen id : 10]
Input [2]: [web_site_sk#18, web_company_name#19]

(29) Filter [codegen id : 10]
Input [2]: [web_site_sk#18, web_company_name#19]
Condition : ((isnotnull(web_company_name#19) AND (web_company_name#19 = pri)) AND isnotnull(web_site_sk#18))

(30) Project [codegen id : 10]
Output [1]: [web_site_sk#18]
Input [2]: [web_site_sk#18, web_company_name#19]

(31) BroadcastExchange
Input [1]: [web_site_sk#18]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20]

(32) BroadcastHashJoin [codegen id : 12]
Left keys [1]: [ws_web_site_sk#3]
Right keys [1]: [web_site_sk#18]
Join condition: None

(33) Project [codegen id : 12]
Output [4]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#18]

(34) Scan parquet default.date_dim
Output [2]: [d_date_sk#21, d_date#22]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date>

(35) ColumnarToRow [codegen id : 11]
Input [2]: [d_date_sk#21, d_date#22]

(36) Filter [codegen id : 11]
Input [2]: [d_date_sk#21, d_date#22]
Condition : (((isnotnull(d_date#22) AND (d_date#22 >= 10623)) AND (d_date#22 <= 10683)) AND isnotnull(d_date_sk#21))

(37) Project [codegen id : 11]
Output [1]: [d_date_sk#21]
Input [2]: [d_date_sk#21, d_date#22]

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

(39) BroadcastHashJoin [codegen id : 12]
Left keys [1]: [ws_ship_date_sk#1]
Right keys [1]: [d_date_sk#21]
Join condition: None

(40) Project [codegen id : 12]
Output [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Input [5]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#21]

(41) HashAggregate [codegen id : 12]
Input [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7]
Keys [1]: [ws_order_number#5]
Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#6)), partial_sum(UnscaledValue(ws_net_profit#7))]
Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25]
Results [3]: [ws_order_number#5, sum#26, sum#27]

(42) Exchange
Input [3]: [ws_order_number#5, sum#26, sum#27]
Arguments: hashpartitioning(ws_order_number#5, 5), true, [id=#28]

(43) HashAggregate [codegen id : 13]
Input [3]: [ws_order_number#5, sum#26, sum#27]
Keys [1]: [ws_order_number#5]
Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7))]
Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25]
Results [3]: [ws_order_number#5, sum#26, sum#27]

(44) HashAggregate [codegen id : 13]
Input [3]: [ws_order_number#5, sum#26, sum#27]
Keys: []
Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7)), partial_count(distinct ws_order_number#5)]
Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25, count(ws_order_number#5)#29]
Results [3]: [sum#26, sum#27, count#30]

(45) Exchange
Input [3]: [sum#26, sum#27, count#30]
Arguments: SinglePartition, true, [id=#31]

(46) HashAggregate [codegen id : 14]
Input [3]: [sum#26, sum#27, count#30]
Keys: []
Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#6)), sum(UnscaledValue(ws_net_profit#7)), count(distinct ws_order_number#5)]
Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#24, sum(UnscaledValue(ws_net_profit#7))#25, count(ws_order_number#5)#29]
Results [3]: [count(ws_order_number#5)#29 AS order count #32, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#6))#24,17,2) AS total shipping cost #33, MakeDecimal(sum(UnscaledValue(ws_net_profit#7))#25,17,2) AS total net profit #34]

(47) Sort [codegen id : 14]
Input [3]: [order count #32, total shipping cost #33, total net profit #34]
Arguments: [order count #32 ASC NULLS FIRST], true, 0

