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


(1) Scan parquet spark_catalog.default.web_sales
Output [4]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#5)]
PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_item_sk)]
ReadSchema: struct<ws_item_sk:int,ws_bill_customer_sk:int,ws_sales_price:decimal(7,2)>

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

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

(4) Scan parquet spark_catalog.default.customer
Output [2]: [c_customer_sk#6, c_current_addr_sk#7]
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>

(5) ColumnarToRow [codegen id : 1]
Input [2]: [c_customer_sk#6, c_current_addr_sk#7]

(6) Filter [codegen id : 1]
Input [2]: [c_customer_sk#6, c_current_addr_sk#7]
Condition : (isnotnull(c_customer_sk#6) AND isnotnull(c_current_addr_sk#7))

(7) BroadcastExchange
Input [2]: [c_customer_sk#6, c_current_addr_sk#7]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]

(8) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ws_bill_customer_sk#3]
Right keys [1]: [c_customer_sk#6]
Join type: Inner
Join condition: None

(9) Project [codegen id : 6]
Output [4]: [ws_item_sk#2, ws_sales_price#4, ws_sold_date_sk#5, c_current_addr_sk#7]
Input [6]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5, c_customer_sk#6, c_current_addr_sk#7]

(10) Scan parquet spark_catalog.default.customer_address
Output [3]: [ca_address_sk#8, ca_city#9, ca_zip#10]
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>

(11) ColumnarToRow [codegen id : 2]
Input [3]: [ca_address_sk#8, ca_city#9, ca_zip#10]

(12) Filter [codegen id : 2]
Input [3]: [ca_address_sk#8, ca_city#9, ca_zip#10]
Condition : isnotnull(ca_address_sk#8)

(13) BroadcastExchange
Input [3]: [ca_address_sk#8, ca_city#9, ca_zip#10]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]

(14) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [c_current_addr_sk#7]
Right keys [1]: [ca_address_sk#8]
Join type: Inner
Join condition: None

(15) Project [codegen id : 6]
Output [5]: [ws_item_sk#2, ws_sales_price#4, ws_sold_date_sk#5, ca_city#9, ca_zip#10]
Input [7]: [ws_item_sk#2, ws_sales_price#4, ws_sold_date_sk#5, c_current_addr_sk#7, ca_address_sk#8, ca_city#9, ca_zip#10]

(16) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#11, d_year#12, d_qoy#13]
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>

(17) ColumnarToRow [codegen id : 3]
Input [3]: [d_date_sk#11, d_year#12, d_qoy#13]

(18) Filter [codegen id : 3]
Input [3]: [d_date_sk#11, d_year#12, d_qoy#13]
Condition : ((((isnotnull(d_qoy#13) AND isnotnull(d_year#12)) AND (d_qoy#13 = 2)) AND (d_year#12 = 2001)) AND isnotnull(d_date_sk#11))

(19) Project [codegen id : 3]
Output [1]: [d_date_sk#11]
Input [3]: [d_date_sk#11, d_year#12, d_qoy#13]

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

(21) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ws_sold_date_sk#5]
Right keys [1]: [d_date_sk#11]
Join type: Inner
Join condition: None

(22) Project [codegen id : 6]
Output [4]: [ws_item_sk#2, ws_sales_price#4, ca_city#9, ca_zip#10]
Input [6]: [ws_item_sk#2, ws_sales_price#4, ws_sold_date_sk#5, ca_city#9, ca_zip#10, d_date_sk#11]

(23) Scan parquet spark_catalog.default.item
Output [2]: [i_item_sk#14, i_item_id#15]
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>

(24) ColumnarToRow [codegen id : 4]
Input [2]: [i_item_sk#14, i_item_id#15]

(25) Filter [codegen id : 4]
Input [2]: [i_item_sk#14, i_item_id#15]
Condition : isnotnull(i_item_sk#14)

(26) BroadcastExchange
Input [2]: [i_item_sk#14, i_item_id#15]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

(27) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ws_item_sk#2]
Right keys [1]: [i_item_sk#14]
Join type: Inner
Join condition: None

(28) Project [codegen id : 6]
Output [4]: [ws_sales_price#4, ca_city#9, ca_zip#10, i_item_id#15]
Input [6]: [ws_item_sk#2, ws_sales_price#4, ca_city#9, ca_zip#10, i_item_sk#14, i_item_id#15]

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

(30) ColumnarToRow [codegen id : 5]
Input [2]: [i_item_sk#16, i_item_id#17]

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

(32) Project [codegen id : 5]
Output [1]: [i_item_id#17]
Input [2]: [i_item_sk#16, i_item_id#17]

(33) BroadcastExchange
Input [1]: [i_item_id#17]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=5]

(34) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [i_item_id#15]
Right keys [1]: [i_item_id#17]
Join type: ExistenceJoin(exists#1)
Join condition: None

(35) Filter [codegen id : 6]
Input [5]: [ws_sales_price#4, ca_city#9, ca_zip#10, i_item_id#15, exists#1]
Condition : (substr(ca_zip#10, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR exists#1)

(36) Project [codegen id : 6]
Output [3]: [ws_sales_price#4, ca_city#9, ca_zip#10]
Input [5]: [ws_sales_price#4, ca_city#9, ca_zip#10, i_item_id#15, exists#1]

(37) HashAggregate [codegen id : 6]
Input [3]: [ws_sales_price#4, ca_city#9, ca_zip#10]
Keys [2]: [ca_zip#10, ca_city#9]
Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#4))]
Aggregate Attributes [1]: [sum#18]
Results [3]: [ca_zip#10, ca_city#9, sum#19]

(38) Exchange
Input [3]: [ca_zip#10, ca_city#9, sum#19]
Arguments: hashpartitioning(ca_zip#10, ca_city#9, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(39) HashAggregate [codegen id : 7]
Input [3]: [ca_zip#10, ca_city#9, sum#19]
Keys [2]: [ca_zip#10, ca_city#9]
Functions [1]: [sum(UnscaledValue(ws_sales_price#4))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#4))#20]
Results [3]: [ca_zip#10, ca_city#9, MakeDecimal(sum(UnscaledValue(ws_sales_price#4))#20,17,2) AS sum(ws_sales_price)#21]

(40) TakeOrderedAndProject
Input [3]: [ca_zip#10, ca_city#9, sum(ws_sales_price)#21]
Arguments: 100, [ca_zip#10 ASC NULLS FIRST, ca_city#9 ASC NULLS FIRST], [ca_zip#10, ca_city#9, sum(ws_sales_price)#21]

