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


(1) Scan parquet spark_catalog.default.inventory
Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)]
ReadSchema: struct<inv_item_sk:int,inv_warehouse_sk:int,inv_quantity_on_hand:int>

(2) ColumnarToRow [codegen id : 4]
Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4]

(3) Filter [codegen id : 4]
Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4]
Condition : (isnotnull(inv_item_sk#1) AND isnotnull(inv_warehouse_sk#2))

(4) Scan parquet spark_catalog.default.item
Output [1]: [i_item_sk#6]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int>

(5) ColumnarToRow [codegen id : 1]
Input [1]: [i_item_sk#6]

(6) Filter [codegen id : 1]
Input [1]: [i_item_sk#6]
Condition : isnotnull(i_item_sk#6)

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

(8) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [inv_item_sk#1]
Right keys [1]: [i_item_sk#6]
Join type: Inner
Join condition: None

(9) Project [codegen id : 4]
Output [4]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6]
Input [5]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6]

(10) Scan parquet spark_catalog.default.warehouse
Output [2]: [w_warehouse_sk#7, w_warehouse_name#8]
Batched: true
Location [not included in comparison]/{warehouse_dir}/warehouse]
PushedFilters: [IsNotNull(w_warehouse_sk)]
ReadSchema: struct<w_warehouse_sk:int,w_warehouse_name:string>

(11) ColumnarToRow [codegen id : 2]
Input [2]: [w_warehouse_sk#7, w_warehouse_name#8]

(12) Filter [codegen id : 2]
Input [2]: [w_warehouse_sk#7, w_warehouse_name#8]
Condition : isnotnull(w_warehouse_sk#7)

(13) BroadcastExchange
Input [2]: [w_warehouse_sk#7, w_warehouse_name#8]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]

(14) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [inv_warehouse_sk#2]
Right keys [1]: [w_warehouse_sk#7]
Join type: Inner
Join condition: None

(15) Project [codegen id : 4]
Output [5]: [inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6, w_warehouse_sk#7, w_warehouse_name#8]
Input [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6, w_warehouse_sk#7, w_warehouse_name#8]

(16) ReusedExchange [Reuses operator id: 49]
Output [2]: [d_date_sk#9, d_moy#10]

(17) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [inv_date_sk#4]
Right keys [1]: [d_date_sk#9]
Join type: Inner
Join condition: None

(18) Project [codegen id : 4]
Output [5]: [inv_quantity_on_hand#3, i_item_sk#6, w_warehouse_sk#7, w_warehouse_name#8, d_moy#10]
Input [7]: [inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6, w_warehouse_sk#7, w_warehouse_name#8, d_date_sk#9, d_moy#10]

(19) HashAggregate [codegen id : 4]
Input [5]: [inv_quantity_on_hand#3, i_item_sk#6, w_warehouse_sk#7, w_warehouse_name#8, d_moy#10]
Keys [4]: [w_warehouse_name#8, w_warehouse_sk#7, i_item_sk#6, d_moy#10]
Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#3 as double)), partial_avg(inv_quantity_on_hand#3)]
Aggregate Attributes [5]: [n#11, avg#12, m2#13, sum#14, count#15]
Results [9]: [w_warehouse_name#8, w_warehouse_sk#7, i_item_sk#6, d_moy#10, n#16, avg#17, m2#18, sum#19, count#20]

(20) Exchange
Input [9]: [w_warehouse_name#8, w_warehouse_sk#7, i_item_sk#6, d_moy#10, n#16, avg#17, m2#18, sum#19, count#20]
Arguments: hashpartitioning(w_warehouse_name#8, w_warehouse_sk#7, i_item_sk#6, d_moy#10, 5), ENSURE_REQUIREMENTS, [plan_id=3]

(21) HashAggregate [codegen id : 10]
Input [9]: [w_warehouse_name#8, w_warehouse_sk#7, i_item_sk#6, d_moy#10, n#16, avg#17, m2#18, sum#19, count#20]
Keys [4]: [w_warehouse_name#8, w_warehouse_sk#7, i_item_sk#6, d_moy#10]
Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#3 as double)), avg(inv_quantity_on_hand#3)]
Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#3 as double))#21, avg(inv_quantity_on_hand#3)#22]
Results [5]: [w_warehouse_sk#7, i_item_sk#6, d_moy#10, stddev_samp(cast(inv_quantity_on_hand#3 as double))#21 AS stdev#23, avg(inv_quantity_on_hand#3)#22 AS mean#24]

(22) Filter [codegen id : 10]
Input [5]: [w_warehouse_sk#7, i_item_sk#6, d_moy#10, stdev#23, mean#24]
Condition : CASE WHEN (mean#24 = 0.0) THEN false ELSE ((stdev#23 / mean#24) > 1.0) END

(23) Project [codegen id : 10]
Output [5]: [w_warehouse_sk#7, i_item_sk#6, d_moy#10, mean#24, CASE WHEN (mean#24 = 0.0) THEN null ELSE (stdev#23 / mean#24) END AS cov#25]
Input [5]: [w_warehouse_sk#7, i_item_sk#6, d_moy#10, stdev#23, mean#24]

(24) Scan parquet spark_catalog.default.inventory
Output [4]: [inv_item_sk#26, inv_warehouse_sk#27, inv_quantity_on_hand#28, inv_date_sk#29]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(inv_date_sk#29), dynamicpruningexpression(inv_date_sk#29 IN dynamicpruning#30)]
PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)]
ReadSchema: struct<inv_item_sk:int,inv_warehouse_sk:int,inv_quantity_on_hand:int>

(25) ColumnarToRow [codegen id : 8]
Input [4]: [inv_item_sk#26, inv_warehouse_sk#27, inv_quantity_on_hand#28, inv_date_sk#29]

(26) Filter [codegen id : 8]
Input [4]: [inv_item_sk#26, inv_warehouse_sk#27, inv_quantity_on_hand#28, inv_date_sk#29]
Condition : (isnotnull(inv_item_sk#26) AND isnotnull(inv_warehouse_sk#27))

(27) ReusedExchange [Reuses operator id: 7]
Output [1]: [i_item_sk#31]

(28) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [inv_item_sk#26]
Right keys [1]: [i_item_sk#31]
Join type: Inner
Join condition: None

(29) Project [codegen id : 8]
Output [4]: [inv_warehouse_sk#27, inv_quantity_on_hand#28, inv_date_sk#29, i_item_sk#31]
Input [5]: [inv_item_sk#26, inv_warehouse_sk#27, inv_quantity_on_hand#28, inv_date_sk#29, i_item_sk#31]

(30) ReusedExchange [Reuses operator id: 13]
Output [2]: [w_warehouse_sk#32, w_warehouse_name#33]

(31) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [inv_warehouse_sk#27]
Right keys [1]: [w_warehouse_sk#32]
Join type: Inner
Join condition: None

(32) Project [codegen id : 8]
Output [5]: [inv_quantity_on_hand#28, inv_date_sk#29, i_item_sk#31, w_warehouse_sk#32, w_warehouse_name#33]
Input [6]: [inv_warehouse_sk#27, inv_quantity_on_hand#28, inv_date_sk#29, i_item_sk#31, w_warehouse_sk#32, w_warehouse_name#33]

(33) ReusedExchange [Reuses operator id: 54]
Output [2]: [d_date_sk#34, d_moy#35]

(34) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [inv_date_sk#29]
Right keys [1]: [d_date_sk#34]
Join type: Inner
Join condition: None

(35) Project [codegen id : 8]
Output [5]: [inv_quantity_on_hand#28, i_item_sk#31, w_warehouse_sk#32, w_warehouse_name#33, d_moy#35]
Input [7]: [inv_quantity_on_hand#28, inv_date_sk#29, i_item_sk#31, w_warehouse_sk#32, w_warehouse_name#33, d_date_sk#34, d_moy#35]

(36) HashAggregate [codegen id : 8]
Input [5]: [inv_quantity_on_hand#28, i_item_sk#31, w_warehouse_sk#32, w_warehouse_name#33, d_moy#35]
Keys [4]: [w_warehouse_name#33, w_warehouse_sk#32, i_item_sk#31, d_moy#35]
Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#28 as double)), partial_avg(inv_quantity_on_hand#28)]
Aggregate Attributes [5]: [n#36, avg#37, m2#38, sum#39, count#40]
Results [9]: [w_warehouse_name#33, w_warehouse_sk#32, i_item_sk#31, d_moy#35, n#41, avg#42, m2#43, sum#44, count#45]

(37) Exchange
Input [9]: [w_warehouse_name#33, w_warehouse_sk#32, i_item_sk#31, d_moy#35, n#41, avg#42, m2#43, sum#44, count#45]
Arguments: hashpartitioning(w_warehouse_name#33, w_warehouse_sk#32, i_item_sk#31, d_moy#35, 5), ENSURE_REQUIREMENTS, [plan_id=4]

(38) HashAggregate [codegen id : 9]
Input [9]: [w_warehouse_name#33, w_warehouse_sk#32, i_item_sk#31, d_moy#35, n#41, avg#42, m2#43, sum#44, count#45]
Keys [4]: [w_warehouse_name#33, w_warehouse_sk#32, i_item_sk#31, d_moy#35]
Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#28 as double)), avg(inv_quantity_on_hand#28)]
Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#28 as double))#21, avg(inv_quantity_on_hand#28)#22]
Results [5]: [w_warehouse_sk#32, i_item_sk#31, d_moy#35, stddev_samp(cast(inv_quantity_on_hand#28 as double))#21 AS stdev#46, avg(inv_quantity_on_hand#28)#22 AS mean#47]

(39) Filter [codegen id : 9]
Input [5]: [w_warehouse_sk#32, i_item_sk#31, d_moy#35, stdev#46, mean#47]
Condition : CASE WHEN (mean#47 = 0.0) THEN false ELSE ((stdev#46 / mean#47) > 1.0) END

(40) Project [codegen id : 9]
Output [5]: [w_warehouse_sk#32, i_item_sk#31, d_moy#35, mean#47, CASE WHEN (mean#47 = 0.0) THEN null ELSE (stdev#46 / mean#47) END AS cov#48]
Input [5]: [w_warehouse_sk#32, i_item_sk#31, d_moy#35, stdev#46, mean#47]

(41) BroadcastExchange
Input [5]: [w_warehouse_sk#32, i_item_sk#31, d_moy#35, mean#47, cov#48]
Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [plan_id=5]

(42) BroadcastHashJoin [codegen id : 10]
Left keys [2]: [i_item_sk#6, w_warehouse_sk#7]
Right keys [2]: [i_item_sk#31, w_warehouse_sk#32]
Join type: Inner
Join condition: None

(43) Exchange
Input [10]: [w_warehouse_sk#7, i_item_sk#6, d_moy#10, mean#24, cov#25, w_warehouse_sk#32, i_item_sk#31, d_moy#35, mean#47, cov#48]
Arguments: rangepartitioning(w_warehouse_sk#7 ASC NULLS FIRST, i_item_sk#6 ASC NULLS FIRST, d_moy#10 ASC NULLS FIRST, mean#24 ASC NULLS FIRST, cov#25 ASC NULLS FIRST, d_moy#35 ASC NULLS FIRST, mean#47 ASC NULLS FIRST, cov#48 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(44) Sort [codegen id : 11]
Input [10]: [w_warehouse_sk#7, i_item_sk#6, d_moy#10, mean#24, cov#25, w_warehouse_sk#32, i_item_sk#31, d_moy#35, mean#47, cov#48]
Arguments: [w_warehouse_sk#7 ASC NULLS FIRST, i_item_sk#6 ASC NULLS FIRST, d_moy#10 ASC NULLS FIRST, mean#24 ASC NULLS FIRST, cov#25 ASC NULLS FIRST, d_moy#35 ASC NULLS FIRST, mean#47 ASC NULLS FIRST, cov#48 ASC NULLS FIRST], true, 0

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5
BroadcastExchange (49)
+- * Project (48)
   +- * Filter (47)
      +- * ColumnarToRow (46)
         +- Scan parquet spark_catalog.default.date_dim (45)


(45) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#9, d_year#49, d_moy#10]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(46) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#9, d_year#49, d_moy#10]

(47) Filter [codegen id : 1]
Input [3]: [d_date_sk#9, d_year#49, d_moy#10]
Condition : ((((isnotnull(d_year#49) AND isnotnull(d_moy#10)) AND (d_year#49 = 2001)) AND (d_moy#10 = 1)) AND isnotnull(d_date_sk#9))

(48) Project [codegen id : 1]
Output [2]: [d_date_sk#9, d_moy#10]
Input [3]: [d_date_sk#9, d_year#49, d_moy#10]

(49) BroadcastExchange
Input [2]: [d_date_sk#9, d_moy#10]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]

Subquery:2 Hosting operator id = 24 Hosting Expression = inv_date_sk#29 IN dynamicpruning#30
BroadcastExchange (54)
+- * Project (53)
   +- * Filter (52)
      +- * ColumnarToRow (51)
         +- Scan parquet spark_catalog.default.date_dim (50)


(50) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#34, d_year#50, d_moy#35]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(51) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#34, d_year#50, d_moy#35]

(52) Filter [codegen id : 1]
Input [3]: [d_date_sk#34, d_year#50, d_moy#35]
Condition : ((((isnotnull(d_year#50) AND isnotnull(d_moy#35)) AND (d_year#50 = 2001)) AND (d_moy#35 = 2)) AND isnotnull(d_date_sk#34))

(53) Project [codegen id : 1]
Output [2]: [d_date_sk#34, d_moy#35]
Input [3]: [d_date_sk#34, d_year#50, d_moy#35]

(54) BroadcastExchange
Input [2]: [d_date_sk#34, d_moy#35]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=8]


