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


(1) Scan parquet default.store_sales
Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_store_sk#3, ss_sales_price#4]
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)>

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

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

(4) Scan parquet default.date_dim
Output [2]: [d_date_sk#5, d_month_seq#6]
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>

(5) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#5, d_month_seq#6]

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

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

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

(9) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [ss_sold_date_sk#1]
Right keys [1]: [d_date_sk#5]
Join condition: None

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

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

(12) Exchange
Input [3]: [ss_store_sk#3, ss_item_sk#2, sum#9]
Arguments: hashpartitioning(ss_store_sk#3, ss_item_sk#2, 5), true, [id=#10]

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

(14) Filter [codegen id : 7]
Input [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12]
Condition : isnotnull(revenue#12)

(15) Scan parquet default.store_sales
Output [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16]
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)>

(16) ColumnarToRow [codegen id : 4]
Input [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16]

(17) Filter [codegen id : 4]
Input [4]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16]
Condition : (((isnotnull(ss_sold_date_sk#13) AND (ss_sold_date_sk#13 >= 2451911)) AND (ss_sold_date_sk#13 <= 2452275)) AND isnotnull(ss_store_sk#15))

(18) ReusedExchange [Reuses operator id: 8]
Output [1]: [d_date_sk#5]

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

(20) Project [codegen id : 4]
Output [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16]
Input [5]: [ss_sold_date_sk#13, ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, d_date_sk#5]

(21) HashAggregate [codegen id : 4]
Input [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16]
Keys [2]: [ss_store_sk#15, ss_item_sk#14]
Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#16))]
Aggregate Attributes [1]: [sum#17]
Results [3]: [ss_store_sk#15, ss_item_sk#14, sum#18]

(22) Exchange
Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#18]
Arguments: hashpartitioning(ss_store_sk#15, ss_item_sk#14, 5), true, [id=#19]

(23) HashAggregate [codegen id : 5]
Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#18]
Keys [2]: [ss_store_sk#15, ss_item_sk#14]
Functions [1]: [sum(UnscaledValue(ss_sales_price#16))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#16))#20]
Results [2]: [ss_store_sk#15, MakeDecimal(sum(UnscaledValue(ss_sales_price#16))#20,17,2) AS revenue#21]

(24) HashAggregate [codegen id : 5]
Input [2]: [ss_store_sk#15, revenue#21]
Keys [1]: [ss_store_sk#15]
Functions [1]: [partial_avg(revenue#21)]
Aggregate Attributes [2]: [sum#22, count#23]
Results [3]: [ss_store_sk#15, sum#24, count#25]

(25) Exchange
Input [3]: [ss_store_sk#15, sum#24, count#25]
Arguments: hashpartitioning(ss_store_sk#15, 5), true, [id=#26]

(26) HashAggregate [codegen id : 6]
Input [3]: [ss_store_sk#15, sum#24, count#25]
Keys [1]: [ss_store_sk#15]
Functions [1]: [avg(revenue#21)]
Aggregate Attributes [1]: [avg(revenue#21)#27]
Results [2]: [ss_store_sk#15, avg(revenue#21)#27 AS ave#28]

(27) BroadcastExchange
Input [2]: [ss_store_sk#15, ave#28]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29]

(28) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [ss_store_sk#3]
Right keys [1]: [ss_store_sk#15]
Join condition: (cast(revenue#12 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#28)), DecimalType(23,7), true))

(29) Project [codegen id : 7]
Output [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12]
Input [5]: [ss_store_sk#3, ss_item_sk#2, revenue#12, ss_store_sk#15, ave#28]

(30) BroadcastExchange
Input [3]: [ss_store_sk#3, ss_item_sk#2, revenue#12]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30]

(31) Scan parquet default.store
Output [2]: [s_store_sk#31, s_store_name#32]
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>

(32) ColumnarToRow
Input [2]: [s_store_sk#31, s_store_name#32]

(33) Filter
Input [2]: [s_store_sk#31, s_store_name#32]
Condition : isnotnull(s_store_sk#31)

(34) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [ss_store_sk#3]
Right keys [1]: [s_store_sk#31]
Join condition: None

(35) Project [codegen id : 8]
Output [3]: [ss_item_sk#2, revenue#12, s_store_name#32]
Input [5]: [ss_store_sk#3, ss_item_sk#2, revenue#12, s_store_sk#31, s_store_name#32]

(36) BroadcastExchange
Input [3]: [ss_item_sk#2, revenue#12, s_store_name#32]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#33]

(37) Scan parquet default.item
Output [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38]
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>

(38) ColumnarToRow
Input [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38]

(39) Filter
Input [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38]
Condition : isnotnull(i_item_sk#34)

(40) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ss_item_sk#2]
Right keys [1]: [i_item_sk#34]
Join condition: None

(41) Project [codegen id : 9]
Output [6]: [s_store_name#32, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38]
Input [8]: [ss_item_sk#2, revenue#12, s_store_name#32, i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38]

(42) TakeOrderedAndProject
Input [6]: [s_store_name#32, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38]
Arguments: 100, [s_store_name#32 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST], [s_store_name#32, i_item_desc#35, revenue#12, i_current_price#36, i_wholesale_cost#37, i_brand#38]

