== Physical Plan ==
TakeOrderedAndProject (72)
+- * Project (71)
   +- BroadcastNestedLoopJoin Inner BuildRight (70)
      :- * HashAggregate (47)
      :  +- Exchange (46)
      :     +- * HashAggregate (45)
      :        +- * Project (44)
      :           +- * BroadcastHashJoin Inner BuildRight (43)
      :              :- * Project (37)
      :              :  +- * BroadcastHashJoin Inner BuildRight (36)
      :              :     :- * Project (30)
      :              :     :  +- * BroadcastHashJoin Inner BuildRight (29)
      :              :     :     :- * Project (24)
      :              :     :     :  +- * BroadcastHashJoin Inner BuildRight (23)
      :              :     :     :     :- * Project (17)
      :              :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (16)
      :              :     :     :     :     :- * 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.store (4)
      :              :     :     :     :     +- BroadcastExchange (15)
      :              :     :     :     :        +- * Project (14)
      :              :     :     :     :           +- * Filter (13)
      :              :     :     :     :              +- * ColumnarToRow (12)
      :              :     :     :     :                 +- Scan parquet default.promotion (11)
      :              :     :     :     +- BroadcastExchange (22)
      :              :     :     :        +- * Project (21)
      :              :     :     :           +- * Filter (20)
      :              :     :     :              +- * ColumnarToRow (19)
      :              :     :     :                 +- Scan parquet default.date_dim (18)
      :              :     :     +- BroadcastExchange (28)
      :              :     :        +- * Filter (27)
      :              :     :           +- * ColumnarToRow (26)
      :              :     :              +- Scan parquet default.customer (25)
      :              :     +- BroadcastExchange (35)
      :              :        +- * Project (34)
      :              :           +- * Filter (33)
      :              :              +- * ColumnarToRow (32)
      :              :                 +- Scan parquet default.customer_address (31)
      :              +- BroadcastExchange (42)
      :                 +- * Project (41)
      :                    +- * Filter (40)
      :                       +- * ColumnarToRow (39)
      :                          +- Scan parquet default.item (38)
      +- BroadcastExchange (69)
         +- * HashAggregate (68)
            +- Exchange (67)
               +- * HashAggregate (66)
                  +- * Project (65)
                     +- * BroadcastHashJoin Inner BuildRight (64)
                        :- * Project (62)
                        :  +- * BroadcastHashJoin Inner BuildRight (61)
                        :     :- * Project (59)
                        :     :  +- * BroadcastHashJoin Inner BuildRight (58)
                        :     :     :- * Project (56)
                        :     :     :  +- * BroadcastHashJoin Inner BuildRight (55)
                        :     :     :     :- * Project (53)
                        :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (52)
                        :     :     :     :     :- * Filter (50)
                        :     :     :     :     :  +- * ColumnarToRow (49)
                        :     :     :     :     :     +- Scan parquet default.store_sales (48)
                        :     :     :     :     +- ReusedExchange (51)
                        :     :     :     +- ReusedExchange (54)
                        :     :     +- ReusedExchange (57)
                        :     +- ReusedExchange (60)
                        +- ReusedExchange (63)


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

(2) ColumnarToRow [codegen id : 7]
Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_promo_sk#5, ss_ext_sales_price#6]

(3) Filter [codegen id : 7]
Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_promo_sk#5, ss_ext_sales_price#6]
Condition : ((((isnotnull(ss_store_sk#4) AND isnotnull(ss_promo_sk#5)) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_customer_sk#3)) AND isnotnull(ss_item_sk#2))

(4) Scan parquet default.store
Output [2]: [s_store_sk#7, s_gmt_offset#8]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store]
PushedFilters: [IsNotNull(s_gmt_offset), EqualTo(s_gmt_offset,-5.00), IsNotNull(s_store_sk)]
ReadSchema: struct<s_store_sk:int,s_gmt_offset:decimal(5,2)>

(5) ColumnarToRow [codegen id : 1]
Input [2]: [s_store_sk#7, s_gmt_offset#8]

(6) Filter [codegen id : 1]
Input [2]: [s_store_sk#7, s_gmt_offset#8]
Condition : ((isnotnull(s_gmt_offset#8) AND (s_gmt_offset#8 = -5.00)) AND isnotnull(s_store_sk#7))

(7) Project [codegen id : 1]
Output [1]: [s_store_sk#7]
Input [2]: [s_store_sk#7, s_gmt_offset#8]

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

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

(10) Project [codegen id : 7]
Output [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_promo_sk#5, ss_ext_sales_price#6]
Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_promo_sk#5, ss_ext_sales_price#6, s_store_sk#7]

(11) Scan parquet default.promotion
Output [4]: [p_promo_sk#10, p_channel_dmail#11, p_channel_email#12, p_channel_tv#13]
Batched: true
Location [not included in comparison]/{warehouse_dir}/promotion]
PushedFilters: [Or(Or(EqualTo(p_channel_dmail,Y),EqualTo(p_channel_email,Y)),EqualTo(p_channel_tv,Y)), IsNotNull(p_promo_sk)]
ReadSchema: struct<p_promo_sk:int,p_channel_dmail:string,p_channel_email:string,p_channel_tv:string>

(12) ColumnarToRow [codegen id : 2]
Input [4]: [p_promo_sk#10, p_channel_dmail#11, p_channel_email#12, p_channel_tv#13]

(13) Filter [codegen id : 2]
Input [4]: [p_promo_sk#10, p_channel_dmail#11, p_channel_email#12, p_channel_tv#13]
Condition : ((((p_channel_dmail#11 = Y) OR (p_channel_email#12 = Y)) OR (p_channel_tv#13 = Y)) AND isnotnull(p_promo_sk#10))

(14) Project [codegen id : 2]
Output [1]: [p_promo_sk#10]
Input [4]: [p_promo_sk#10, p_channel_dmail#11, p_channel_email#12, p_channel_tv#13]

(15) BroadcastExchange
Input [1]: [p_promo_sk#10]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14]

(16) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [ss_promo_sk#5]
Right keys [1]: [p_promo_sk#10]
Join condition: None

(17) Project [codegen id : 7]
Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ext_sales_price#6]
Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_promo_sk#5, ss_ext_sales_price#6, p_promo_sk#10]

(18) Scan parquet default.date_dim
Output [3]: [d_date_sk#15, d_year#16, d_moy#17]
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,11), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(19) ColumnarToRow [codegen id : 3]
Input [3]: [d_date_sk#15, d_year#16, d_moy#17]

(20) Filter [codegen id : 3]
Input [3]: [d_date_sk#15, d_year#16, d_moy#17]
Condition : ((((isnotnull(d_year#16) AND isnotnull(d_moy#17)) AND (d_year#16 = 1998)) AND (d_moy#17 = 11)) AND isnotnull(d_date_sk#15))

(21) Project [codegen id : 3]
Output [1]: [d_date_sk#15]
Input [3]: [d_date_sk#15, d_year#16, d_moy#17]

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

(23) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [ss_sold_date_sk#1]
Right keys [1]: [d_date_sk#15]
Join condition: None

(24) Project [codegen id : 7]
Output [3]: [ss_item_sk#2, ss_customer_sk#3, ss_ext_sales_price#6]
Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ext_sales_price#6, d_date_sk#15]

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

(26) ColumnarToRow [codegen id : 4]
Input [2]: [c_customer_sk#19, c_current_addr_sk#20]

(27) Filter [codegen id : 4]
Input [2]: [c_customer_sk#19, c_current_addr_sk#20]
Condition : (isnotnull(c_customer_sk#19) AND isnotnull(c_current_addr_sk#20))

(28) BroadcastExchange
Input [2]: [c_customer_sk#19, c_current_addr_sk#20]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21]

(29) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [ss_customer_sk#3]
Right keys [1]: [c_customer_sk#19]
Join condition: None

(30) Project [codegen id : 7]
Output [3]: [ss_item_sk#2, ss_ext_sales_price#6, c_current_addr_sk#20]
Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_ext_sales_price#6, c_customer_sk#19, c_current_addr_sk#20]

(31) Scan parquet default.customer_address
Output [2]: [ca_address_sk#22, ca_gmt_offset#23]
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)>

(32) ColumnarToRow [codegen id : 5]
Input [2]: [ca_address_sk#22, ca_gmt_offset#23]

(33) Filter [codegen id : 5]
Input [2]: [ca_address_sk#22, ca_gmt_offset#23]
Condition : ((isnotnull(ca_gmt_offset#23) AND (ca_gmt_offset#23 = -5.00)) AND isnotnull(ca_address_sk#22))

(34) Project [codegen id : 5]
Output [1]: [ca_address_sk#22]
Input [2]: [ca_address_sk#22, ca_gmt_offset#23]

(35) BroadcastExchange
Input [1]: [ca_address_sk#22]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24]

(36) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [c_current_addr_sk#20]
Right keys [1]: [ca_address_sk#22]
Join condition: None

(37) Project [codegen id : 7]
Output [2]: [ss_item_sk#2, ss_ext_sales_price#6]
Input [4]: [ss_item_sk#2, ss_ext_sales_price#6, c_current_addr_sk#20, ca_address_sk#22]

(38) Scan parquet default.item
Output [2]: [i_item_sk#25, i_category#26]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Jewelry), IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_category:string>

(39) ColumnarToRow [codegen id : 6]
Input [2]: [i_item_sk#25, i_category#26]

(40) Filter [codegen id : 6]
Input [2]: [i_item_sk#25, i_category#26]
Condition : ((isnotnull(i_category#26) AND (i_category#26 = Jewelry)) AND isnotnull(i_item_sk#25))

(41) Project [codegen id : 6]
Output [1]: [i_item_sk#25]
Input [2]: [i_item_sk#25, i_category#26]

(42) BroadcastExchange
Input [1]: [i_item_sk#25]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27]

(43) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [ss_item_sk#2]
Right keys [1]: [i_item_sk#25]
Join condition: None

(44) Project [codegen id : 7]
Output [1]: [ss_ext_sales_price#6]
Input [3]: [ss_item_sk#2, ss_ext_sales_price#6, i_item_sk#25]

(45) HashAggregate [codegen id : 7]
Input [1]: [ss_ext_sales_price#6]
Keys: []
Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#6))]
Aggregate Attributes [1]: [sum#28]
Results [1]: [sum#29]

(46) Exchange
Input [1]: [sum#29]
Arguments: SinglePartition, true, [id=#30]

(47) HashAggregate [codegen id : 8]
Input [1]: [sum#29]
Keys: []
Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#31]
Results [1]: [MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#31,17,2) AS promotions#32]

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

(49) ColumnarToRow [codegen id : 14]
Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6]

(50) Filter [codegen id : 14]
Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6]
Condition : (((isnotnull(ss_store_sk#4) AND isnotnull(ss_sold_date_sk#1)) AND isnotnull(ss_customer_sk#3)) AND isnotnull(ss_item_sk#2))

(51) ReusedExchange [Reuses operator id: 8]
Output [1]: [s_store_sk#7]

(52) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [ss_store_sk#4]
Right keys [1]: [s_store_sk#7]
Join condition: None

(53) Project [codegen id : 14]
Output [4]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ext_sales_price#6]
Input [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_store_sk#4, ss_ext_sales_price#6, s_store_sk#7]

(54) ReusedExchange [Reuses operator id: 22]
Output [1]: [d_date_sk#15]

(55) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [ss_sold_date_sk#1]
Right keys [1]: [d_date_sk#15]
Join condition: None

(56) Project [codegen id : 14]
Output [3]: [ss_item_sk#2, ss_customer_sk#3, ss_ext_sales_price#6]
Input [5]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ext_sales_price#6, d_date_sk#15]

(57) ReusedExchange [Reuses operator id: 28]
Output [2]: [c_customer_sk#19, c_current_addr_sk#20]

(58) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [ss_customer_sk#3]
Right keys [1]: [c_customer_sk#19]
Join condition: None

(59) Project [codegen id : 14]
Output [3]: [ss_item_sk#2, ss_ext_sales_price#6, c_current_addr_sk#20]
Input [5]: [ss_item_sk#2, ss_customer_sk#3, ss_ext_sales_price#6, c_customer_sk#19, c_current_addr_sk#20]

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

(61) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [c_current_addr_sk#20]
Right keys [1]: [ca_address_sk#22]
Join condition: None

(62) Project [codegen id : 14]
Output [2]: [ss_item_sk#2, ss_ext_sales_price#6]
Input [4]: [ss_item_sk#2, ss_ext_sales_price#6, c_current_addr_sk#20, ca_address_sk#22]

(63) ReusedExchange [Reuses operator id: 42]
Output [1]: [i_item_sk#25]

(64) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [ss_item_sk#2]
Right keys [1]: [i_item_sk#25]
Join condition: None

(65) Project [codegen id : 14]
Output [1]: [ss_ext_sales_price#6]
Input [3]: [ss_item_sk#2, ss_ext_sales_price#6, i_item_sk#25]

(66) HashAggregate [codegen id : 14]
Input [1]: [ss_ext_sales_price#6]
Keys: []
Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#6))]
Aggregate Attributes [1]: [sum#33]
Results [1]: [sum#34]

(67) Exchange
Input [1]: [sum#34]
Arguments: SinglePartition, true, [id=#35]

(68) HashAggregate [codegen id : 15]
Input [1]: [sum#34]
Keys: []
Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#36]
Results [1]: [MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#36,17,2) AS total#37]

(69) BroadcastExchange
Input [1]: [total#37]
Arguments: IdentityBroadcastMode, [id=#38]

(70) BroadcastNestedLoopJoin
Join condition: None

(71) Project [codegen id : 16]
Output [3]: [promotions#32, total#37, CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(promotions#32 as decimal(15,4))) / promote_precision(cast(total#37 as decimal(15,4)))), DecimalType(35,20), true)) * 100.00000000000000000000), DecimalType(38,19), true) AS (CAST((CAST(CAST(promotions AS DECIMAL(15,4)) AS DECIMAL(15,4)) / CAST(CAST(total AS DECIMAL(15,4)) AS DECIMAL(15,4))) AS DECIMAL(35,20)) * CAST(CAST(100 AS DECIMAL(3,0)) AS DECIMAL(35,20)))#39]
Input [2]: [promotions#32, total#37]

(72) TakeOrderedAndProject
Input [3]: [promotions#32, total#37, (CAST((CAST(CAST(promotions AS DECIMAL(15,4)) AS DECIMAL(15,4)) / CAST(CAST(total AS DECIMAL(15,4)) AS DECIMAL(15,4))) AS DECIMAL(35,20)) * CAST(CAST(100 AS DECIMAL(3,0)) AS DECIMAL(35,20)))#39]
Arguments: 100, [promotions#32 ASC NULLS FIRST, total#37 ASC NULLS FIRST], [promotions#32, total#37, (CAST((CAST(CAST(promotions AS DECIMAL(15,4)) AS DECIMAL(15,4)) / CAST(CAST(total AS DECIMAL(15,4)) AS DECIMAL(15,4))) AS DECIMAL(35,20)) * CAST(CAST(100 AS DECIMAL(3,0)) AS DECIMAL(35,20)))#39]

