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


(1) Scan parquet default.web_sales
Output [4]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_sales]
PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk), IsNotNull(ws_item_sk)]
ReadSchema: struct<ws_sold_date_sk:int,ws_item_sk:int,ws_bill_customer_sk:int,ws_sales_price:decimal(7,2)>

(2) ColumnarToRow [codegen id : 3]
Input [4]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5]

(3) Filter [codegen id : 3]
Input [4]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5]
Condition : ((isnotnull(ws_bill_customer_sk#4) AND isnotnull(ws_sold_date_sk#2)) AND isnotnull(ws_item_sk#3))

(4) Scan parquet default.date_dim
Output [3]: [d_date_sk#6, d_year#7, d_qoy#8]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_qoy:int>

(5) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#6, d_year#7, d_qoy#8]

(6) Filter [codegen id : 1]
Input [3]: [d_date_sk#6, d_year#7, d_qoy#8]
Condition : ((((isnotnull(d_qoy#8) AND isnotnull(d_year#7)) AND (d_qoy#8 = 2)) AND (d_year#7 = 2001)) AND isnotnull(d_date_sk#6))

(7) Project [codegen id : 1]
Output [1]: [d_date_sk#6]
Input [3]: [d_date_sk#6, d_year#7, d_qoy#8]

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

(9) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ws_sold_date_sk#2]
Right keys [1]: [d_date_sk#6]
Join condition: None

(10) Project [codegen id : 3]
Output [3]: [ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5]
Input [5]: [ws_sold_date_sk#2, ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5, d_date_sk#6]

(11) Scan parquet default.item
Output [2]: [i_item_sk#10, i_item_id#11]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_item_id:string>

(12) ColumnarToRow [codegen id : 2]
Input [2]: [i_item_sk#10, i_item_id#11]

(13) Filter [codegen id : 2]
Input [2]: [i_item_sk#10, i_item_id#11]
Condition : isnotnull(i_item_sk#10)

(14) BroadcastExchange
Input [2]: [i_item_sk#10, i_item_id#11]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12]

(15) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ws_item_sk#3]
Right keys [1]: [i_item_sk#10]
Join condition: None

(16) Project [codegen id : 3]
Output [3]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11]
Input [5]: [ws_item_sk#3, ws_bill_customer_sk#4, ws_sales_price#5, i_item_sk#10, i_item_id#11]

(17) Exchange
Input [3]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11]
Arguments: hashpartitioning(ws_bill_customer_sk#4, 5), true, [id=#13]

(18) Sort [codegen id : 4]
Input [3]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11]
Arguments: [ws_bill_customer_sk#4 ASC NULLS FIRST], false, 0

(19) Scan parquet default.customer
Output [2]: [c_customer_sk#14, c_current_addr_sk#15]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)]
ReadSchema: struct<c_customer_sk:int,c_current_addr_sk:int>

(20) ColumnarToRow [codegen id : 5]
Input [2]: [c_customer_sk#14, c_current_addr_sk#15]

(21) Filter [codegen id : 5]
Input [2]: [c_customer_sk#14, c_current_addr_sk#15]
Condition : (isnotnull(c_customer_sk#14) AND isnotnull(c_current_addr_sk#15))

(22) Exchange
Input [2]: [c_customer_sk#14, c_current_addr_sk#15]
Arguments: hashpartitioning(c_current_addr_sk#15, 5), true, [id=#16]

(23) Sort [codegen id : 6]
Input [2]: [c_customer_sk#14, c_current_addr_sk#15]
Arguments: [c_current_addr_sk#15 ASC NULLS FIRST], false, 0

(24) Scan parquet default.customer_address
Output [3]: [ca_address_sk#17, ca_city#18, ca_zip#19]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_city:string,ca_zip:string>

(25) ColumnarToRow [codegen id : 7]
Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19]

(26) Filter [codegen id : 7]
Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19]
Condition : isnotnull(ca_address_sk#17)

(27) Exchange
Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19]
Arguments: hashpartitioning(ca_address_sk#17, 5), true, [id=#20]

(28) Sort [codegen id : 8]
Input [3]: [ca_address_sk#17, ca_city#18, ca_zip#19]
Arguments: [ca_address_sk#17 ASC NULLS FIRST], false, 0

(29) SortMergeJoin [codegen id : 9]
Left keys [1]: [c_current_addr_sk#15]
Right keys [1]: [ca_address_sk#17]
Join condition: None

(30) Project [codegen id : 9]
Output [3]: [c_customer_sk#14, ca_city#18, ca_zip#19]
Input [5]: [c_customer_sk#14, c_current_addr_sk#15, ca_address_sk#17, ca_city#18, ca_zip#19]

(31) Exchange
Input [3]: [c_customer_sk#14, ca_city#18, ca_zip#19]
Arguments: hashpartitioning(c_customer_sk#14, 5), true, [id=#21]

(32) Sort [codegen id : 10]
Input [3]: [c_customer_sk#14, ca_city#18, ca_zip#19]
Arguments: [c_customer_sk#14 ASC NULLS FIRST], false, 0

(33) SortMergeJoin [codegen id : 12]
Left keys [1]: [ws_bill_customer_sk#4]
Right keys [1]: [c_customer_sk#14]
Join condition: None

(34) Project [codegen id : 12]
Output [4]: [ws_sales_price#5, ca_city#18, ca_zip#19, i_item_id#11]
Input [6]: [ws_bill_customer_sk#4, ws_sales_price#5, i_item_id#11, c_customer_sk#14, ca_city#18, ca_zip#19]

(35) Scan parquet default.item
Output [2]: [i_item_sk#10, i_item_id#11]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [In(i_item_sk, [2,3,5,7,11,13,17,19,23,29])]
ReadSchema: struct<i_item_sk:int,i_item_id:string>

(36) ColumnarToRow [codegen id : 11]
Input [2]: [i_item_sk#10, i_item_id#11]

(37) Filter [codegen id : 11]
Input [2]: [i_item_sk#10, i_item_id#11]
Condition : i_item_sk#10 IN (2,3,5,7,11,13,17,19,23,29)

(38) Project [codegen id : 11]
Output [1]: [i_item_id#11 AS i_item_id#11#22]
Input [2]: [i_item_sk#10, i_item_id#11]

(39) BroadcastExchange
Input [1]: [i_item_id#11#22]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#23]

(40) BroadcastHashJoin [codegen id : 12]
Left keys [1]: [i_item_id#11]
Right keys [1]: [i_item_id#11#22]
Join condition: None

(41) Filter [codegen id : 12]
Input [5]: [ws_sales_price#5, ca_city#18, ca_zip#19, i_item_id#11, exists#1]
Condition : (substr(ca_zip#19, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR exists#1)

(42) Project [codegen id : 12]
Output [3]: [ws_sales_price#5, ca_city#18, ca_zip#19]
Input [5]: [ws_sales_price#5, ca_city#18, ca_zip#19, i_item_id#11, exists#1]

(43) HashAggregate [codegen id : 12]
Input [3]: [ws_sales_price#5, ca_city#18, ca_zip#19]
Keys [2]: [ca_zip#19, ca_city#18]
Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#5))]
Aggregate Attributes [1]: [sum#24]
Results [3]: [ca_zip#19, ca_city#18, sum#25]

(44) Exchange
Input [3]: [ca_zip#19, ca_city#18, sum#25]
Arguments: hashpartitioning(ca_zip#19, ca_city#18, 5), true, [id=#26]

(45) HashAggregate [codegen id : 13]
Input [3]: [ca_zip#19, ca_city#18, sum#25]
Keys [2]: [ca_zip#19, ca_city#18]
Functions [1]: [sum(UnscaledValue(ws_sales_price#5))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#5))#27]
Results [3]: [ca_zip#19, ca_city#18, MakeDecimal(sum(UnscaledValue(ws_sales_price#5))#27,17,2) AS sum(ws_sales_price)#28]

(46) TakeOrderedAndProject
Input [3]: [ca_zip#19, ca_city#18, sum(ws_sales_price)#28]
Arguments: 100, [ca_zip#19 ASC NULLS FIRST, ca_city#18 ASC NULLS FIRST], [ca_zip#19, ca_city#18, sum(ws_sales_price)#28]

