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


(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), dynamicpruningexpression(ws_sold_date_sk#5 IN dynamicpruning#6)]
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) CometNativeScan parquet spark_catalog.default.customer
Output [2]: [c_customer_sk#7, c_current_addr_sk#8]
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) CometFilter
Input [2]: [c_customer_sk#7, c_current_addr_sk#8]
Condition : (isnotnull(c_customer_sk#7) AND isnotnull(c_current_addr_sk#8))

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

(7) BroadcastExchange
Input [2]: [c_customer_sk#7, c_current_addr_sk#8]
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#7]
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#8]
Input [6]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5, c_customer_sk#7, c_current_addr_sk#8]

(10) CometNativeScan parquet spark_catalog.default.customer_address
Output [3]: [ca_address_sk#9, ca_city#10, ca_zip#11]
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) CometFilter
Input [3]: [ca_address_sk#9, ca_city#10, ca_zip#11]
Condition : isnotnull(ca_address_sk#9)

(12) CometProject
Input [3]: [ca_address_sk#9, ca_city#10, ca_zip#11]
Arguments: [ca_address_sk#9, ca_city#10, ca_zip#12], [ca_address_sk#9, ca_city#10, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, ca_zip#11, 10, true, false, true) AS ca_zip#12]

(13) CometColumnarToRow [codegen id : 2]
Input [3]: [ca_address_sk#9, ca_city#10, ca_zip#12]

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

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

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

(17) ReusedExchange [Reuses operator id: 44]
Output [1]: [d_date_sk#13]

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

(19) Project [codegen id : 6]
Output [4]: [ws_item_sk#2, ws_sales_price#4, ca_city#10, ca_zip#12]
Input [6]: [ws_item_sk#2, ws_sales_price#4, ws_sold_date_sk#5, ca_city#10, ca_zip#12, d_date_sk#13]

(20) CometNativeScan 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>

(21) CometFilter
Input [2]: [i_item_sk#14, i_item_id#15]
Condition : isnotnull(i_item_sk#14)

(22) CometProject
Input [2]: [i_item_sk#14, i_item_id#15]
Arguments: [i_item_sk#14, i_item_id#16], [i_item_sk#14, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, i_item_id#15, 16, true, false, true) AS i_item_id#16]

(23) CometColumnarToRow [codegen id : 4]
Input [2]: [i_item_sk#14, i_item_id#16]

(24) BroadcastExchange
Input [2]: [i_item_sk#14, i_item_id#16]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]

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

(26) Project [codegen id : 6]
Output [4]: [ws_sales_price#4, ca_city#10, ca_zip#12, i_item_id#16]
Input [6]: [ws_item_sk#2, ws_sales_price#4, ca_city#10, ca_zip#12, i_item_sk#14, i_item_id#16]

(27) CometNativeScan parquet spark_catalog.default.item
Output [2]: [i_item_sk#17, i_item_id#18]
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>

(28) CometFilter
Input [2]: [i_item_sk#17, i_item_id#18]
Condition : i_item_sk#17 IN (2,3,5,7,11,13,17,19,23,29)

(29) CometProject
Input [2]: [i_item_sk#17, i_item_id#18]
Arguments: [i_item_id#19], [staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, i_item_id#18, 16, true, false, true) AS i_item_id#19]

(30) CometColumnarToRow [codegen id : 5]
Input [1]: [i_item_id#19]

(31) BroadcastExchange
Input [1]: [i_item_id#19]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=4]

(32) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [i_item_id#16]
Right keys [1]: [i_item_id#19]
Join type: ExistenceJoin(exists#1)
Join condition: None

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

(34) Project [codegen id : 6]
Output [3]: [ws_sales_price#4, ca_city#10, ca_zip#12]
Input [5]: [ws_sales_price#4, ca_city#10, ca_zip#12, i_item_id#16, exists#1]

(35) HashAggregate [codegen id : 6]
Input [3]: [ws_sales_price#4, ca_city#10, ca_zip#12]
Keys [2]: [ca_zip#12, ca_city#10]
Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#4))]
Aggregate Attributes [1]: [sum#20]
Results [3]: [ca_zip#12, ca_city#10, sum#21]

(36) CometColumnarExchange
Input [3]: [ca_zip#12, ca_city#10, sum#21]
Arguments: hashpartitioning(ca_zip#12, ca_city#10, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=5]

(37) CometColumnarToRow [codegen id : 7]
Input [3]: [ca_zip#12, ca_city#10, sum#21]

(38) HashAggregate [codegen id : 7]
Input [3]: [ca_zip#12, ca_city#10, sum#21]
Keys [2]: [ca_zip#12, ca_city#10]
Functions [1]: [sum(UnscaledValue(ws_sales_price#4))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#4))#22]
Results [3]: [ca_zip#12, ca_city#10, MakeDecimal(sum(UnscaledValue(ws_sales_price#4))#22,17,2) AS sum(ws_sales_price)#23]

(39) TakeOrderedAndProject
Input [3]: [ca_zip#12, ca_city#10, sum(ws_sales_price)#23]
Arguments: 100, [ca_zip#12 ASC NULLS FIRST, ca_city#10 ASC NULLS FIRST], [ca_zip#12, ca_city#10, sum(ws_sales_price)#23]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#5 IN dynamicpruning#6
BroadcastExchange (44)
+- * CometColumnarToRow (43)
   +- CometProject (42)
      +- CometFilter (41)
         +- CometNativeScan parquet spark_catalog.default.date_dim (40)


(40) CometNativeScan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#13, d_year#24, d_qoy#25]
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>

(41) CometFilter
Input [3]: [d_date_sk#13, d_year#24, d_qoy#25]
Condition : ((((isnotnull(d_qoy#25) AND isnotnull(d_year#24)) AND (d_qoy#25 = 2)) AND (d_year#24 = 2001)) AND isnotnull(d_date_sk#13))

(42) CometProject
Input [3]: [d_date_sk#13, d_year#24, d_qoy#25]
Arguments: [d_date_sk#13], [d_date_sk#13]

(43) CometColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#13]

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


