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


(1) Scan parquet default.catalog_sales
Output [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
Batched: true
Location [not included in comparison]/{warehouse_dir}/catalog_sales]
PushedFilters: [IsNotNull(cs_ship_date_sk), IsNotNull(cs_ship_addr_sk), IsNotNull(cs_call_center_sk)]
ReadSchema: struct<cs_ship_date_sk:int,cs_ship_addr_sk:int,cs_call_center_sk:int,cs_warehouse_sk:int,cs_order_number:int,cs_ext_ship_cost:decimal(7,2),cs_net_profit:decimal(7,2)>

(2) ColumnarToRow [codegen id : 1]
Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]

(3) Filter [codegen id : 1]
Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
Condition : ((isnotnull(cs_ship_date_sk#1) AND isnotnull(cs_ship_addr_sk#2)) AND isnotnull(cs_call_center_sk#3))

(4) Exchange
Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
Arguments: hashpartitioning(cs_order_number#5, 5), true, [id=#8]

(5) Sort [codegen id : 2]
Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
Arguments: [cs_order_number#5 ASC NULLS FIRST], false, 0

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

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

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

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

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

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

(12) Project [codegen id : 5]
Output [6]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]

(13) Scan parquet default.catalog_returns
Output [1]: [cr_order_number#12]
Batched: true
Location [not included in comparison]/{warehouse_dir}/catalog_returns]
ReadSchema: struct<cr_order_number:int>

(14) ColumnarToRow [codegen id : 6]
Input [1]: [cr_order_number#12]

(15) Exchange
Input [1]: [cr_order_number#12]
Arguments: hashpartitioning(cr_order_number#12, 5), true, [id=#13]

(16) Sort [codegen id : 7]
Input [1]: [cr_order_number#12]
Arguments: [cr_order_number#12 ASC NULLS FIRST], false, 0

(17) SortMergeJoin
Left keys [1]: [cs_order_number#5]
Right keys [1]: [cr_order_number#12]
Join condition: None

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

(19) ColumnarToRow [codegen id : 8]
Input [2]: [ca_address_sk#14, ca_state#15]

(20) Filter [codegen id : 8]
Input [2]: [ca_address_sk#14, ca_state#15]
Condition : ((isnotnull(ca_state#15) AND (ca_state#15 = GA)) AND isnotnull(ca_address_sk#14))

(21) Project [codegen id : 8]
Output [1]: [ca_address_sk#14]
Input [2]: [ca_address_sk#14, ca_state#15]

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

(23) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [cs_ship_addr_sk#2]
Right keys [1]: [ca_address_sk#14]
Join condition: None

(24) Project [codegen id : 11]
Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, ca_address_sk#14]

(25) Scan parquet default.call_center
Output [2]: [cc_call_center_sk#17, cc_county#18]
Batched: true
Location [not included in comparison]/{warehouse_dir}/call_center]
PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)]
ReadSchema: struct<cc_call_center_sk:int,cc_county:string>

(26) ColumnarToRow [codegen id : 9]
Input [2]: [cc_call_center_sk#17, cc_county#18]

(27) Filter [codegen id : 9]
Input [2]: [cc_call_center_sk#17, cc_county#18]
Condition : ((isnotnull(cc_county#18) AND (cc_county#18 = Williamson County)) AND isnotnull(cc_call_center_sk#17))

(28) Project [codegen id : 9]
Output [1]: [cc_call_center_sk#17]
Input [2]: [cc_call_center_sk#17, cc_county#18]

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

(30) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [cs_call_center_sk#3]
Right keys [1]: [cc_call_center_sk#17]
Join condition: None

(31) Project [codegen id : 11]
Output [4]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#17]

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

(33) ColumnarToRow [codegen id : 10]
Input [2]: [d_date_sk#20, d_date#21]

(34) Filter [codegen id : 10]
Input [2]: [d_date_sk#20, d_date#21]
Condition : (((isnotnull(d_date#21) AND (d_date#21 >= 11719)) AND (d_date#21 <= 11779)) AND isnotnull(d_date_sk#20))

(35) Project [codegen id : 10]
Output [1]: [d_date_sk#20]
Input [2]: [d_date_sk#20, d_date#21]

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

(37) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [cs_ship_date_sk#1]
Right keys [1]: [d_date_sk#20]
Join condition: None

(38) Project [codegen id : 11]
Output [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
Input [5]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#20]

(39) HashAggregate [codegen id : 11]
Input [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
Keys [1]: [cs_order_number#5]
Functions [2]: [partial_sum(UnscaledValue(cs_ext_ship_cost#6)), partial_sum(UnscaledValue(cs_net_profit#7))]
Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_ship_cost#6))#23, sum(UnscaledValue(cs_net_profit#7))#24]
Results [3]: [cs_order_number#5, sum#25, sum#26]

(40) HashAggregate [codegen id : 11]
Input [3]: [cs_order_number#5, sum#25, sum#26]
Keys [1]: [cs_order_number#5]
Functions [2]: [merge_sum(UnscaledValue(cs_ext_ship_cost#6)), merge_sum(UnscaledValue(cs_net_profit#7))]
Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_ship_cost#6))#23, sum(UnscaledValue(cs_net_profit#7))#24]
Results [3]: [cs_order_number#5, sum#25, sum#26]

(41) HashAggregate [codegen id : 11]
Input [3]: [cs_order_number#5, sum#25, sum#26]
Keys: []
Functions [3]: [merge_sum(UnscaledValue(cs_ext_ship_cost#6)), merge_sum(UnscaledValue(cs_net_profit#7)), partial_count(distinct cs_order_number#5)]
Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_ship_cost#6))#23, sum(UnscaledValue(cs_net_profit#7))#24, count(cs_order_number#5)#27]
Results [3]: [sum#25, sum#26, count#28]

(42) Exchange
Input [3]: [sum#25, sum#26, count#28]
Arguments: SinglePartition, true, [id=#29]

(43) HashAggregate [codegen id : 12]
Input [3]: [sum#25, sum#26, count#28]
Keys: []
Functions [3]: [sum(UnscaledValue(cs_ext_ship_cost#6)), sum(UnscaledValue(cs_net_profit#7)), count(distinct cs_order_number#5)]
Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_ship_cost#6))#23, sum(UnscaledValue(cs_net_profit#7))#24, count(cs_order_number#5)#27]
Results [3]: [count(cs_order_number#5)#27 AS order count #30, MakeDecimal(sum(UnscaledValue(cs_ext_ship_cost#6))#23,17,2) AS total shipping cost #31, MakeDecimal(sum(UnscaledValue(cs_net_profit#7))#24,17,2) AS total net profit #32]

(44) Sort [codegen id : 12]
Input [3]: [order count #30, total shipping cost #31, total net profit #32]
Arguments: [order count #30 ASC NULLS FIRST], true, 0

