== Physical Plan ==
TakeOrderedAndProject (74)
+- * HashAggregate (73)
   +- * CometColumnarToRow (72)
      +- CometColumnarExchange (71)
         +- * HashAggregate (70)
            +- Union (69)
               :- * HashAggregate (28)
               :  +- * CometColumnarToRow (27)
               :     +- CometColumnarExchange (26)
               :        +- * HashAggregate (25)
               :           +- * Project (24)
               :              +- * BroadcastHashJoin Inner BuildRight (23)
               :                 :- * Project (13)
               :                 :  +- * BroadcastHashJoin Inner BuildRight (12)
               :                 :     :- * Project (6)
               :                 :     :  +- * BroadcastHashJoin Inner BuildRight (5)
               :                 :     :     :- * Filter (3)
               :                 :     :     :  +- * ColumnarToRow (2)
               :                 :     :     :     +- Scan parquet spark_catalog.default.store_sales (1)
               :                 :     :     +- ReusedExchange (4)
               :                 :     +- BroadcastExchange (11)
               :                 :        +- * CometColumnarToRow (10)
               :                 :           +- CometProject (9)
               :                 :              +- CometFilter (8)
               :                 :                 +- CometNativeScan parquet spark_catalog.default.customer_address (7)
               :                 +- BroadcastExchange (22)
               :                    +- * CometColumnarToRow (21)
               :                       +- CometBroadcastHashJoin (20)
               :                          :- CometFilter (15)
               :                          :  +- CometNativeScan parquet spark_catalog.default.item (14)
               :                          +- CometBroadcastExchange (19)
               :                             +- CometProject (18)
               :                                +- CometFilter (17)
               :                                   +- CometNativeScan parquet spark_catalog.default.item (16)
               :- * HashAggregate (52)
               :  +- * CometColumnarToRow (51)
               :     +- CometColumnarExchange (50)
               :        +- * HashAggregate (49)
               :           +- * Project (48)
               :              +- * BroadcastHashJoin Inner BuildRight (47)
               :                 :- * Project (37)
               :                 :  +- * BroadcastHashJoin Inner BuildRight (36)
               :                 :     :- * Project (34)
               :                 :     :  +- * BroadcastHashJoin Inner BuildRight (33)
               :                 :     :     :- * Filter (31)
               :                 :     :     :  +- * ColumnarToRow (30)
               :                 :     :     :     +- Scan parquet spark_catalog.default.catalog_sales (29)
               :                 :     :     +- ReusedExchange (32)
               :                 :     +- ReusedExchange (35)
               :                 +- BroadcastExchange (46)
               :                    +- * CometColumnarToRow (45)
               :                       +- CometBroadcastHashJoin (44)
               :                          :- CometFilter (39)
               :                          :  +- CometNativeScan parquet spark_catalog.default.item (38)
               :                          +- CometBroadcastExchange (43)
               :                             +- CometProject (42)
               :                                +- CometFilter (41)
               :                                   +- CometNativeScan parquet spark_catalog.default.item (40)
               +- * HashAggregate (68)
                  +- * CometColumnarToRow (67)
                     +- CometColumnarExchange (66)
                        +- * HashAggregate (65)
                           +- * Project (64)
                              +- * BroadcastHashJoin Inner BuildRight (63)
                                 :- * Project (61)
                                 :  +- * BroadcastHashJoin Inner BuildRight (60)
                                 :     :- * Project (58)
                                 :     :  +- * BroadcastHashJoin Inner BuildRight (57)
                                 :     :     :- * Filter (55)
                                 :     :     :  +- * ColumnarToRow (54)
                                 :     :     :     +- Scan parquet spark_catalog.default.web_sales (53)
                                 :     :     +- ReusedExchange (56)
                                 :     +- ReusedExchange (59)
                                 +- ReusedExchange (62)


(1) Scan parquet spark_catalog.default.store_sales
Output [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_item_sk:int,ss_addr_sk:int,ss_ext_sales_price:decimal(7,2)>

(2) ColumnarToRow [codegen id : 4]
Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4]

(3) Filter [codegen id : 4]
Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4]
Condition : (isnotnull(ss_addr_sk#2) AND isnotnull(ss_item_sk#1))

(4) ReusedExchange [Reuses operator id: 79]
Output [1]: [d_date_sk#6]

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

(6) Project [codegen id : 4]
Output [3]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3]
Input [5]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, d_date_sk#6]

(7) CometNativeScan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#7, ca_gmt_offset#8]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-5.00), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_gmt_offset:decimal(5,2)>

(8) CometFilter
Input [2]: [ca_address_sk#7, ca_gmt_offset#8]
Condition : ((isnotnull(ca_gmt_offset#8) AND (ca_gmt_offset#8 = -5.00)) AND isnotnull(ca_address_sk#7))

(9) CometProject
Input [2]: [ca_address_sk#7, ca_gmt_offset#8]
Arguments: [ca_address_sk#7], [ca_address_sk#7]

(10) CometColumnarToRow [codegen id : 2]
Input [1]: [ca_address_sk#7]

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

(12) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [ss_addr_sk#2]
Right keys [1]: [ca_address_sk#7]
Join type: Inner
Join condition: None

(13) Project [codegen id : 4]
Output [2]: [ss_item_sk#1, ss_ext_sales_price#3]
Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ca_address_sk#7]

(14) CometNativeScan parquet spark_catalog.default.item
Output [2]: [i_item_sk#9, i_manufact_id#10]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_manufact_id:int>

(15) CometFilter
Input [2]: [i_item_sk#9, i_manufact_id#10]
Condition : isnotnull(i_item_sk#9)

(16) CometNativeScan parquet spark_catalog.default.item
Output [2]: [i_category#11, i_manufact_id#10]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
ReadSchema: struct<i_category:string,i_manufact_id:int>

(17) CometFilter
Input [2]: [i_category#11, i_manufact_id#10]
Condition : (staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, i_category#11, 50, true, false, true) = Electronics                                       )

(18) CometProject
Input [2]: [i_category#11, i_manufact_id#10]
Arguments: [i_manufact_id#10#12], [i_manufact_id#10 AS i_manufact_id#10#12]

(19) CometBroadcastExchange
Input [1]: [i_manufact_id#10#12]
Arguments: [i_manufact_id#10#12]

(20) CometBroadcastHashJoin
Left output [2]: [i_item_sk#9, i_manufact_id#10]
Right output [1]: [i_manufact_id#10#12]
Arguments: [i_manufact_id#10], [i_manufact_id#10#12], LeftSemi, BuildRight

(21) CometColumnarToRow [codegen id : 3]
Input [2]: [i_item_sk#9, i_manufact_id#10]

(22) BroadcastExchange
Input [2]: [i_item_sk#9, i_manufact_id#10]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]

(23) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [ss_item_sk#1]
Right keys [1]: [i_item_sk#9]
Join type: Inner
Join condition: None

(24) Project [codegen id : 4]
Output [2]: [ss_ext_sales_price#3, i_manufact_id#10]
Input [4]: [ss_item_sk#1, ss_ext_sales_price#3, i_item_sk#9, i_manufact_id#10]

(25) HashAggregate [codegen id : 4]
Input [2]: [ss_ext_sales_price#3, i_manufact_id#10]
Keys [1]: [i_manufact_id#10]
Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))]
Aggregate Attributes [1]: [sum#13]
Results [2]: [i_manufact_id#10, sum#14]

(26) CometColumnarExchange
Input [2]: [i_manufact_id#10, sum#14]
Arguments: hashpartitioning(i_manufact_id#10, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=3]

(27) CometColumnarToRow [codegen id : 5]
Input [2]: [i_manufact_id#10, sum#14]

(28) HashAggregate [codegen id : 5]
Input [2]: [i_manufact_id#10, sum#14]
Keys [1]: [i_manufact_id#10]
Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#15]
Results [2]: [i_manufact_id#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#15,17,2) AS total_sales#16]

(29) Scan parquet spark_catalog.default.catalog_sales
Output [4]: [cs_bill_addr_sk#17, cs_item_sk#18, cs_ext_sales_price#19, cs_sold_date_sk#20]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#20), dynamicpruningexpression(cs_sold_date_sk#20 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)]
ReadSchema: struct<cs_bill_addr_sk:int,cs_item_sk:int,cs_ext_sales_price:decimal(7,2)>

(30) ColumnarToRow [codegen id : 9]
Input [4]: [cs_bill_addr_sk#17, cs_item_sk#18, cs_ext_sales_price#19, cs_sold_date_sk#20]

(31) Filter [codegen id : 9]
Input [4]: [cs_bill_addr_sk#17, cs_item_sk#18, cs_ext_sales_price#19, cs_sold_date_sk#20]
Condition : (isnotnull(cs_bill_addr_sk#17) AND isnotnull(cs_item_sk#18))

(32) ReusedExchange [Reuses operator id: 79]
Output [1]: [d_date_sk#21]

(33) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [cs_sold_date_sk#20]
Right keys [1]: [d_date_sk#21]
Join type: Inner
Join condition: None

(34) Project [codegen id : 9]
Output [3]: [cs_bill_addr_sk#17, cs_item_sk#18, cs_ext_sales_price#19]
Input [5]: [cs_bill_addr_sk#17, cs_item_sk#18, cs_ext_sales_price#19, cs_sold_date_sk#20, d_date_sk#21]

(35) ReusedExchange [Reuses operator id: 11]
Output [1]: [ca_address_sk#22]

(36) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [cs_bill_addr_sk#17]
Right keys [1]: [ca_address_sk#22]
Join type: Inner
Join condition: None

(37) Project [codegen id : 9]
Output [2]: [cs_item_sk#18, cs_ext_sales_price#19]
Input [4]: [cs_bill_addr_sk#17, cs_item_sk#18, cs_ext_sales_price#19, ca_address_sk#22]

(38) CometNativeScan parquet spark_catalog.default.item
Output [2]: [i_item_sk#23, i_manufact_id#24]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_manufact_id:int>

(39) CometFilter
Input [2]: [i_item_sk#23, i_manufact_id#24]
Condition : isnotnull(i_item_sk#23)

(40) CometNativeScan parquet spark_catalog.default.item
Output [2]: [i_category#11, i_manufact_id#10]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
ReadSchema: struct<i_category:string,i_manufact_id:int>

(41) CometFilter
Input [2]: [i_category#11, i_manufact_id#10]
Condition : (staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, i_category#11, 50, true, false, true) = Electronics                                       )

(42) CometProject
Input [2]: [i_category#11, i_manufact_id#10]
Arguments: [i_manufact_id#10], [i_manufact_id#10]

(43) CometBroadcastExchange
Input [1]: [i_manufact_id#10]
Arguments: [i_manufact_id#10]

(44) CometBroadcastHashJoin
Left output [2]: [i_item_sk#23, i_manufact_id#24]
Right output [1]: [i_manufact_id#10]
Arguments: [i_manufact_id#24], [i_manufact_id#10], LeftSemi, BuildRight

(45) CometColumnarToRow [codegen id : 8]
Input [2]: [i_item_sk#23, i_manufact_id#24]

(46) BroadcastExchange
Input [2]: [i_item_sk#23, i_manufact_id#24]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

(47) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [cs_item_sk#18]
Right keys [1]: [i_item_sk#23]
Join type: Inner
Join condition: None

(48) Project [codegen id : 9]
Output [2]: [cs_ext_sales_price#19, i_manufact_id#24]
Input [4]: [cs_item_sk#18, cs_ext_sales_price#19, i_item_sk#23, i_manufact_id#24]

(49) HashAggregate [codegen id : 9]
Input [2]: [cs_ext_sales_price#19, i_manufact_id#24]
Keys [1]: [i_manufact_id#24]
Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#19))]
Aggregate Attributes [1]: [sum#25]
Results [2]: [i_manufact_id#24, sum#26]

(50) CometColumnarExchange
Input [2]: [i_manufact_id#24, sum#26]
Arguments: hashpartitioning(i_manufact_id#24, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=5]

(51) CometColumnarToRow [codegen id : 10]
Input [2]: [i_manufact_id#24, sum#26]

(52) HashAggregate [codegen id : 10]
Input [2]: [i_manufact_id#24, sum#26]
Keys [1]: [i_manufact_id#24]
Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#19))]
Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#19))#27]
Results [2]: [i_manufact_id#24, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#19))#27,17,2) AS total_sales#28]

(53) Scan parquet spark_catalog.default.web_sales
Output [4]: [ws_item_sk#29, ws_bill_addr_sk#30, ws_ext_sales_price#31, ws_sold_date_sk#32]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#32), dynamicpruningexpression(ws_sold_date_sk#32 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)]
ReadSchema: struct<ws_item_sk:int,ws_bill_addr_sk:int,ws_ext_sales_price:decimal(7,2)>

(54) ColumnarToRow [codegen id : 14]
Input [4]: [ws_item_sk#29, ws_bill_addr_sk#30, ws_ext_sales_price#31, ws_sold_date_sk#32]

(55) Filter [codegen id : 14]
Input [4]: [ws_item_sk#29, ws_bill_addr_sk#30, ws_ext_sales_price#31, ws_sold_date_sk#32]
Condition : (isnotnull(ws_bill_addr_sk#30) AND isnotnull(ws_item_sk#29))

(56) ReusedExchange [Reuses operator id: 79]
Output [1]: [d_date_sk#33]

(57) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [ws_sold_date_sk#32]
Right keys [1]: [d_date_sk#33]
Join type: Inner
Join condition: None

(58) Project [codegen id : 14]
Output [3]: [ws_item_sk#29, ws_bill_addr_sk#30, ws_ext_sales_price#31]
Input [5]: [ws_item_sk#29, ws_bill_addr_sk#30, ws_ext_sales_price#31, ws_sold_date_sk#32, d_date_sk#33]

(59) ReusedExchange [Reuses operator id: 11]
Output [1]: [ca_address_sk#34]

(60) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [ws_bill_addr_sk#30]
Right keys [1]: [ca_address_sk#34]
Join type: Inner
Join condition: None

(61) Project [codegen id : 14]
Output [2]: [ws_item_sk#29, ws_ext_sales_price#31]
Input [4]: [ws_item_sk#29, ws_bill_addr_sk#30, ws_ext_sales_price#31, ca_address_sk#34]

(62) ReusedExchange [Reuses operator id: 46]
Output [2]: [i_item_sk#35, i_manufact_id#36]

(63) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [ws_item_sk#29]
Right keys [1]: [i_item_sk#35]
Join type: Inner
Join condition: None

(64) Project [codegen id : 14]
Output [2]: [ws_ext_sales_price#31, i_manufact_id#36]
Input [4]: [ws_item_sk#29, ws_ext_sales_price#31, i_item_sk#35, i_manufact_id#36]

(65) HashAggregate [codegen id : 14]
Input [2]: [ws_ext_sales_price#31, i_manufact_id#36]
Keys [1]: [i_manufact_id#36]
Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#31))]
Aggregate Attributes [1]: [sum#37]
Results [2]: [i_manufact_id#36, sum#38]

(66) CometColumnarExchange
Input [2]: [i_manufact_id#36, sum#38]
Arguments: hashpartitioning(i_manufact_id#36, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=6]

(67) CometColumnarToRow [codegen id : 15]
Input [2]: [i_manufact_id#36, sum#38]

(68) HashAggregate [codegen id : 15]
Input [2]: [i_manufact_id#36, sum#38]
Keys [1]: [i_manufact_id#36]
Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#31))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#31))#39]
Results [2]: [i_manufact_id#36, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#31))#39,17,2) AS total_sales#40]

(69) Union

(70) HashAggregate [codegen id : 16]
Input [2]: [i_manufact_id#10, total_sales#16]
Keys [1]: [i_manufact_id#10]
Functions [1]: [partial_sum(total_sales#16)]
Aggregate Attributes [2]: [sum#41, isEmpty#42]
Results [3]: [i_manufact_id#10, sum#43, isEmpty#44]

(71) CometColumnarExchange
Input [3]: [i_manufact_id#10, sum#43, isEmpty#44]
Arguments: hashpartitioning(i_manufact_id#10, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=7]

(72) CometColumnarToRow [codegen id : 17]
Input [3]: [i_manufact_id#10, sum#43, isEmpty#44]

(73) HashAggregate [codegen id : 17]
Input [3]: [i_manufact_id#10, sum#43, isEmpty#44]
Keys [1]: [i_manufact_id#10]
Functions [1]: [sum(total_sales#16)]
Aggregate Attributes [1]: [sum(total_sales#16)#45]
Results [2]: [i_manufact_id#10, sum(total_sales#16)#45 AS total_sales#46]

(74) TakeOrderedAndProject
Input [2]: [i_manufact_id#10, total_sales#46]
Arguments: 100, [total_sales#46 ASC NULLS FIRST], [i_manufact_id#10, total_sales#46]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5
BroadcastExchange (79)
+- * CometColumnarToRow (78)
   +- CometProject (77)
      +- CometFilter (76)
         +- CometNativeScan parquet spark_catalog.default.date_dim (75)


(75) CometNativeScan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#6, d_year#47, d_moy#48]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,5), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(76) CometFilter
Input [3]: [d_date_sk#6, d_year#47, d_moy#48]
Condition : ((((isnotnull(d_year#47) AND isnotnull(d_moy#48)) AND (d_year#47 = 1998)) AND (d_moy#48 = 5)) AND isnotnull(d_date_sk#6))

(77) CometProject
Input [3]: [d_date_sk#6, d_year#47, d_moy#48]
Arguments: [d_date_sk#6], [d_date_sk#6]

(78) CometColumnarToRow [codegen id : 1]
Input [1]: [d_date_sk#6]

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

Subquery:2 Hosting operator id = 29 Hosting Expression = cs_sold_date_sk#20 IN dynamicpruning#5

Subquery:3 Hosting operator id = 53 Hosting Expression = ws_sold_date_sk#32 IN dynamicpruning#5


