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


(1) Scan parquet default.store
Output [2]: [s_store_sk#1, s_store_name#2]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store]
PushedFilters: [IsNotNull(s_store_sk)]
ReadSchema: struct<s_store_sk:int,s_store_name:string>

(2) ColumnarToRow [codegen id : 9]
Input [2]: [s_store_sk#1, s_store_name#2]

(3) Filter [codegen id : 9]
Input [2]: [s_store_sk#1, s_store_name#2]
Condition : isnotnull(s_store_sk#1)

(4) Scan parquet default.store_sales
Output [4]: [ss_sold_date_sk#3, ss_item_sk#4, ss_store_sk#5, ss_sales_price#6]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2452275), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_sold_date_sk:int,ss_item_sk:int,ss_store_sk:int,ss_sales_price:decimal(7,2)>

(5) ColumnarToRow [codegen id : 2]
Input [4]: [ss_sold_date_sk#3, ss_item_sk#4, ss_store_sk#5, ss_sales_price#6]

(6) Filter [codegen id : 2]
Input [4]: [ss_sold_date_sk#3, ss_item_sk#4, ss_store_sk#5, ss_sales_price#6]
Condition : ((((isnotnull(ss_sold_date_sk#3) AND (ss_sold_date_sk#3 >= 2451911)) AND (ss_sold_date_sk#3 <= 2452275)) AND isnotnull(ss_store_sk#5)) AND isnotnull(ss_item_sk#4))

(7) Scan parquet default.date_dim
Output [2]: [d_date_sk#7, d_month_seq#8]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2452275), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_month_seq:int>

(8) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#7, d_month_seq#8]

(9) Filter [codegen id : 1]
Input [2]: [d_date_sk#7, d_month_seq#8]
Condition : (((((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1212)) AND (d_month_seq#8 <= 1223)) AND (d_date_sk#7 >= 2451911)) AND (d_date_sk#7 <= 2452275)) AND isnotnull(d_date_sk#7))

(10) Project [codegen id : 1]
Output [1]: [d_date_sk#7]
Input [2]: [d_date_sk#7, d_month_seq#8]

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

(12) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [ss_sold_date_sk#3]
Right keys [1]: [d_date_sk#7]
Join condition: None

(13) Project [codegen id : 2]
Output [3]: [ss_item_sk#4, ss_store_sk#5, ss_sales_price#6]
Input [5]: [ss_sold_date_sk#3, ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, d_date_sk#7]

(14) HashAggregate [codegen id : 2]
Input [3]: [ss_item_sk#4, ss_store_sk#5, ss_sales_price#6]
Keys [2]: [ss_store_sk#5, ss_item_sk#4]
Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#6))]
Aggregate Attributes [1]: [sum#10]
Results [3]: [ss_store_sk#5, ss_item_sk#4, sum#11]

(15) Exchange
Input [3]: [ss_store_sk#5, ss_item_sk#4, sum#11]
Arguments: hashpartitioning(ss_store_sk#5, ss_item_sk#4, 5), true, [id=#12]

(16) HashAggregate [codegen id : 3]
Input [3]: [ss_store_sk#5, ss_item_sk#4, sum#11]
Keys [2]: [ss_store_sk#5, ss_item_sk#4]
Functions [1]: [sum(UnscaledValue(ss_sales_price#6))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#6))#13]
Results [3]: [ss_store_sk#5, ss_item_sk#4, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#13,17,2) AS revenue#14]

(17) Filter [codegen id : 3]
Input [3]: [ss_store_sk#5, ss_item_sk#4, revenue#14]
Condition : isnotnull(revenue#14)

(18) BroadcastExchange
Input [3]: [ss_store_sk#5, ss_item_sk#4, revenue#14]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15]

(19) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [s_store_sk#1]
Right keys [1]: [ss_store_sk#5]
Join condition: None

(20) Project [codegen id : 9]
Output [4]: [s_store_name#2, ss_store_sk#5, ss_item_sk#4, revenue#14]
Input [5]: [s_store_sk#1, s_store_name#2, ss_store_sk#5, ss_item_sk#4, revenue#14]

(21) Scan parquet default.item
Output [5]: [i_item_sk#16, i_item_desc#17, i_current_price#18, i_wholesale_cost#19, i_brand#20]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_item_desc:string,i_current_price:decimal(7,2),i_wholesale_cost:decimal(7,2),i_brand:string>

(22) ColumnarToRow [codegen id : 4]
Input [5]: [i_item_sk#16, i_item_desc#17, i_current_price#18, i_wholesale_cost#19, i_brand#20]

(23) Filter [codegen id : 4]
Input [5]: [i_item_sk#16, i_item_desc#17, i_current_price#18, i_wholesale_cost#19, i_brand#20]
Condition : isnotnull(i_item_sk#16)

(24) BroadcastExchange
Input [5]: [i_item_sk#16, i_item_desc#17, i_current_price#18, i_wholesale_cost#19, i_brand#20]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21]

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

(26) Project [codegen id : 9]
Output [7]: [s_store_name#2, ss_store_sk#5, revenue#14, i_item_desc#17, i_current_price#18, i_wholesale_cost#19, i_brand#20]
Input [9]: [s_store_name#2, ss_store_sk#5, ss_item_sk#4, revenue#14, i_item_sk#16, i_item_desc#17, i_current_price#18, i_wholesale_cost#19, i_brand#20]

(27) Scan parquet default.store_sales
Output [4]: [ss_sold_date_sk#22, ss_item_sk#23, ss_store_sk#24, ss_sales_price#25]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_sold_date_sk), GreaterThanOrEqual(ss_sold_date_sk,2451911), LessThanOrEqual(ss_sold_date_sk,2452275), IsNotNull(ss_store_sk)]
ReadSchema: struct<ss_sold_date_sk:int,ss_item_sk:int,ss_store_sk:int,ss_sales_price:decimal(7,2)>

(28) ColumnarToRow [codegen id : 6]
Input [4]: [ss_sold_date_sk#22, ss_item_sk#23, ss_store_sk#24, ss_sales_price#25]

(29) Filter [codegen id : 6]
Input [4]: [ss_sold_date_sk#22, ss_item_sk#23, ss_store_sk#24, ss_sales_price#25]
Condition : (((isnotnull(ss_sold_date_sk#22) AND (ss_sold_date_sk#22 >= 2451911)) AND (ss_sold_date_sk#22 <= 2452275)) AND isnotnull(ss_store_sk#24))

(30) ReusedExchange [Reuses operator id: 11]
Output [1]: [d_date_sk#7]

(31) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_sold_date_sk#22]
Right keys [1]: [d_date_sk#7]
Join condition: None

(32) Project [codegen id : 6]
Output [3]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25]
Input [5]: [ss_sold_date_sk#22, ss_item_sk#23, ss_store_sk#24, ss_sales_price#25, d_date_sk#7]

(33) HashAggregate [codegen id : 6]
Input [3]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25]
Keys [2]: [ss_store_sk#24, ss_item_sk#23]
Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#25))]
Aggregate Attributes [1]: [sum#26]
Results [3]: [ss_store_sk#24, ss_item_sk#23, sum#27]

(34) Exchange
Input [3]: [ss_store_sk#24, ss_item_sk#23, sum#27]
Arguments: hashpartitioning(ss_store_sk#24, ss_item_sk#23, 5), true, [id=#28]

(35) HashAggregate [codegen id : 7]
Input [3]: [ss_store_sk#24, ss_item_sk#23, sum#27]
Keys [2]: [ss_store_sk#24, ss_item_sk#23]
Functions [1]: [sum(UnscaledValue(ss_sales_price#25))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#25))#29]
Results [2]: [ss_store_sk#24, MakeDecimal(sum(UnscaledValue(ss_sales_price#25))#29,17,2) AS revenue#30]

(36) HashAggregate [codegen id : 7]
Input [2]: [ss_store_sk#24, revenue#30]
Keys [1]: [ss_store_sk#24]
Functions [1]: [partial_avg(revenue#30)]
Aggregate Attributes [2]: [sum#31, count#32]
Results [3]: [ss_store_sk#24, sum#33, count#34]

(37) Exchange
Input [3]: [ss_store_sk#24, sum#33, count#34]
Arguments: hashpartitioning(ss_store_sk#24, 5), true, [id=#35]

(38) HashAggregate [codegen id : 8]
Input [3]: [ss_store_sk#24, sum#33, count#34]
Keys [1]: [ss_store_sk#24]
Functions [1]: [avg(revenue#30)]
Aggregate Attributes [1]: [avg(revenue#30)#36]
Results [2]: [ss_store_sk#24, avg(revenue#30)#36 AS ave#37]

(39) BroadcastExchange
Input [2]: [ss_store_sk#24, ave#37]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#38]

(40) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ss_store_sk#5]
Right keys [1]: [ss_store_sk#24]
Join condition: (cast(revenue#14 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#37)), DecimalType(23,7), true))

(41) Project [codegen id : 9]
Output [6]: [s_store_name#2, i_item_desc#17, revenue#14, i_current_price#18, i_wholesale_cost#19, i_brand#20]
Input [9]: [s_store_name#2, ss_store_sk#5, revenue#14, i_item_desc#17, i_current_price#18, i_wholesale_cost#19, i_brand#20, ss_store_sk#24, ave#37]

(42) TakeOrderedAndProject
Input [6]: [s_store_name#2, i_item_desc#17, revenue#14, i_current_price#18, i_wholesale_cost#19, i_brand#20]
Arguments: 100, [s_store_name#2 ASC NULLS FIRST, i_item_desc#17 ASC NULLS FIRST], [s_store_name#2, i_item_desc#17, revenue#14, i_current_price#18, i_wholesale_cost#19, i_brand#20]

