== Physical Plan ==
* Sort (39)
+- Exchange (38)
   +- * HashAggregate (37)
      +- Exchange (36)
         +- * HashAggregate (35)
            +- * Project (34)
               +- * BroadcastHashJoin Inner BuildRight (33)
                  :- * Project (28)
                  :  +- * BroadcastHashJoin Inner BuildRight (27)
                  :     :- * Project (22)
                  :     :  +- * BroadcastHashJoin Inner BuildRight (21)
                  :     :     :- * Project (16)
                  :     :     :  +- * BroadcastHashJoin Inner BuildRight (15)
                  :     :     :     :- * Project (10)
                  :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (9)
                  :     :     :     :     :- * Project (4)
                  :     :     :     :     :  +- * Filter (3)
                  :     :     :     :     :     +- * ColumnarToRow (2)
                  :     :     :     :     :        +- Scan parquet default.part (1)
                  :     :     :     :     +- BroadcastExchange (8)
                  :     :     :     :        +- * Filter (7)
                  :     :     :     :           +- * ColumnarToRow (6)
                  :     :     :     :              +- Scan parquet default.lineitem (5)
                  :     :     :     +- BroadcastExchange (14)
                  :     :     :        +- * Filter (13)
                  :     :     :           +- * ColumnarToRow (12)
                  :     :     :              +- Scan parquet default.supplier (11)
                  :     :     +- BroadcastExchange (20)
                  :     :        +- * Filter (19)
                  :     :           +- * ColumnarToRow (18)
                  :     :              +- Scan parquet default.partsupp (17)
                  :     +- BroadcastExchange (26)
                  :        +- * Filter (25)
                  :           +- * ColumnarToRow (24)
                  :              +- Scan parquet default.orders (23)
                  +- BroadcastExchange (32)
                     +- * Filter (31)
                        +- * ColumnarToRow (30)
                           +- Scan parquet default.nation (29)


(1) Scan parquet default.part
Output [2]: [p_partkey#1, p_name#2]
Batched: true
Location [not included in comparison]/{warehouse_dir}/part]
PushedFilters: [IsNotNull(p_name), StringContains(p_name,green), IsNotNull(p_partkey)]
ReadSchema: struct<p_partkey:bigint,p_name:string>

(2) ColumnarToRow [codegen id : 6]
Input [2]: [p_partkey#1, p_name#2]

(3) Filter [codegen id : 6]
Input [2]: [p_partkey#1, p_name#2]
Condition : ((isnotnull(p_name#2) AND Contains(p_name#2, green)) AND isnotnull(p_partkey#1))

(4) Project [codegen id : 6]
Output [1]: [p_partkey#1]
Input [2]: [p_partkey#1, p_name#2]

(5) Scan parquet default.lineitem
Output [6]: [l_orderkey#3, l_partkey#4, l_suppkey#5, l_quantity#6, l_extendedprice#7, l_discount#8]
Batched: true
Location [not included in comparison]/{warehouse_dir}/lineitem]
PushedFilters: [IsNotNull(l_partkey), IsNotNull(l_suppkey), IsNotNull(l_orderkey)]
ReadSchema: struct<l_orderkey:bigint,l_partkey:bigint,l_suppkey:bigint,l_quantity:decimal(10,0),l_extendedprice:decimal(10,0),l_discount:decimal(10,0)>

(6) ColumnarToRow [codegen id : 1]
Input [6]: [l_orderkey#3, l_partkey#4, l_suppkey#5, l_quantity#6, l_extendedprice#7, l_discount#8]

(7) Filter [codegen id : 1]
Input [6]: [l_orderkey#3, l_partkey#4, l_suppkey#5, l_quantity#6, l_extendedprice#7, l_discount#8]
Condition : ((isnotnull(l_partkey#4) AND isnotnull(l_suppkey#5)) AND isnotnull(l_orderkey#3))

(8) BroadcastExchange
Input [6]: [l_orderkey#3, l_partkey#4, l_suppkey#5, l_quantity#6, l_extendedprice#7, l_discount#8]
Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false]),false), [id=#9]

(9) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [p_partkey#1]
Right keys [1]: [l_partkey#4]
Join condition: None

(10) Project [codegen id : 6]
Output [6]: [l_orderkey#3, l_partkey#4, l_suppkey#5, l_quantity#6, l_extendedprice#7, l_discount#8]
Input [7]: [p_partkey#1, l_orderkey#3, l_partkey#4, l_suppkey#5, l_quantity#6, l_extendedprice#7, l_discount#8]

(11) Scan parquet default.supplier
Output [2]: [s_suppkey#10, s_nationkey#11]
Batched: true
Location [not included in comparison]/{warehouse_dir}/supplier]
PushedFilters: [IsNotNull(s_suppkey), IsNotNull(s_nationkey)]
ReadSchema: struct<s_suppkey:bigint,s_nationkey:bigint>

(12) ColumnarToRow [codegen id : 2]
Input [2]: [s_suppkey#10, s_nationkey#11]

(13) Filter [codegen id : 2]
Input [2]: [s_suppkey#10, s_nationkey#11]
Condition : (isnotnull(s_suppkey#10) AND isnotnull(s_nationkey#11))

(14) BroadcastExchange
Input [2]: [s_suppkey#10, s_nationkey#11]
Arguments: HashedRelationBroadcastMode(List(input[0, bigint, false]),false), [id=#12]

(15) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [l_suppkey#5]
Right keys [1]: [s_suppkey#10]
Join condition: None

(16) Project [codegen id : 6]
Output [7]: [l_orderkey#3, l_partkey#4, l_suppkey#5, l_quantity#6, l_extendedprice#7, l_discount#8, s_nationkey#11]
Input [8]: [l_orderkey#3, l_partkey#4, l_suppkey#5, l_quantity#6, l_extendedprice#7, l_discount#8, s_suppkey#10, s_nationkey#11]

(17) Scan parquet default.partsupp
Output [3]: [ps_partkey#13, ps_suppkey#14, ps_supplycost#15]
Batched: true
Location [not included in comparison]/{warehouse_dir}/partsupp]
PushedFilters: [IsNotNull(ps_suppkey), IsNotNull(ps_partkey)]
ReadSchema: struct<ps_partkey:bigint,ps_suppkey:bigint,ps_supplycost:decimal(10,0)>

(18) ColumnarToRow [codegen id : 3]
Input [3]: [ps_partkey#13, ps_suppkey#14, ps_supplycost#15]

(19) Filter [codegen id : 3]
Input [3]: [ps_partkey#13, ps_suppkey#14, ps_supplycost#15]
Condition : (isnotnull(ps_suppkey#14) AND isnotnull(ps_partkey#13))

(20) BroadcastExchange
Input [3]: [ps_partkey#13, ps_suppkey#14, ps_supplycost#15]
Arguments: HashedRelationBroadcastMode(List(input[1, bigint, false], input[0, bigint, false]),false), [id=#16]

(21) BroadcastHashJoin [codegen id : 6]
Left keys [2]: [l_suppkey#5, l_partkey#4]
Right keys [2]: [ps_suppkey#14, ps_partkey#13]
Join condition: None

(22) Project [codegen id : 6]
Output [6]: [l_orderkey#3, l_quantity#6, l_extendedprice#7, l_discount#8, s_nationkey#11, ps_supplycost#15]
Input [10]: [l_orderkey#3, l_partkey#4, l_suppkey#5, l_quantity#6, l_extendedprice#7, l_discount#8, s_nationkey#11, ps_partkey#13, ps_suppkey#14, ps_supplycost#15]

(23) Scan parquet default.orders
Output [2]: [o_orderkey#17, o_orderdate#18]
Batched: true
Location [not included in comparison]/{warehouse_dir}/orders]
PushedFilters: [IsNotNull(o_orderkey)]
ReadSchema: struct<o_orderkey:bigint,o_orderdate:date>

(24) ColumnarToRow [codegen id : 4]
Input [2]: [o_orderkey#17, o_orderdate#18]

(25) Filter [codegen id : 4]
Input [2]: [o_orderkey#17, o_orderdate#18]
Condition : isnotnull(o_orderkey#17)

(26) BroadcastExchange
Input [2]: [o_orderkey#17, o_orderdate#18]
Arguments: HashedRelationBroadcastMode(List(input[0, bigint, false]),false), [id=#19]

(27) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [l_orderkey#3]
Right keys [1]: [o_orderkey#17]
Join condition: None

(28) Project [codegen id : 6]
Output [6]: [l_quantity#6, l_extendedprice#7, l_discount#8, s_nationkey#11, ps_supplycost#15, o_orderdate#18]
Input [8]: [l_orderkey#3, l_quantity#6, l_extendedprice#7, l_discount#8, s_nationkey#11, ps_supplycost#15, o_orderkey#17, o_orderdate#18]

(29) Scan parquet default.nation
Output [2]: [n_nationkey#20, n_name#21]
Batched: true
Location [not included in comparison]/{warehouse_dir}/nation]
PushedFilters: [IsNotNull(n_nationkey)]
ReadSchema: struct<n_nationkey:bigint,n_name:string>

(30) ColumnarToRow [codegen id : 5]
Input [2]: [n_nationkey#20, n_name#21]

(31) Filter [codegen id : 5]
Input [2]: [n_nationkey#20, n_name#21]
Condition : isnotnull(n_nationkey#20)

(32) BroadcastExchange
Input [2]: [n_nationkey#20, n_name#21]
Arguments: HashedRelationBroadcastMode(List(input[0, bigint, false]),false), [id=#22]

(33) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [s_nationkey#11]
Right keys [1]: [n_nationkey#20]
Join condition: None

(34) Project [codegen id : 6]
Output [3]: [n_name#21 AS nation#23, year(o_orderdate#18) AS o_year#24, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(l_extendedprice#7 as decimal(11,0))) * promote_precision(CheckOverflow((1 - promote_precision(cast(l_discount#8 as decimal(11,0)))), DecimalType(11,0), true))), DecimalType(22,0), true) as decimal(23,0))) - promote_precision(cast(CheckOverflow((promote_precision(ps_supplycost#15) * promote_precision(l_quantity#6)), DecimalType(21,0), true) as decimal(23,0)))), DecimalType(23,0), true) AS amount#25]
Input [8]: [l_quantity#6, l_extendedprice#7, l_discount#8, s_nationkey#11, ps_supplycost#15, o_orderdate#18, n_nationkey#20, n_name#21]

(35) HashAggregate [codegen id : 6]
Input [3]: [nation#23, o_year#24, amount#25]
Keys [2]: [nation#23, o_year#24]
Functions [1]: [partial_sum(amount#25)]
Aggregate Attributes [2]: [sum#26, isEmpty#27]
Results [4]: [nation#23, o_year#24, sum#28, isEmpty#29]

(36) Exchange
Input [4]: [nation#23, o_year#24, sum#28, isEmpty#29]
Arguments: hashpartitioning(nation#23, o_year#24, 5), ENSURE_REQUIREMENTS, [id=#30]

(37) HashAggregate [codegen id : 7]
Input [4]: [nation#23, o_year#24, sum#28, isEmpty#29]
Keys [2]: [nation#23, o_year#24]
Functions [1]: [sum(amount#25)]
Aggregate Attributes [1]: [sum(amount#25)#31]
Results [3]: [nation#23, o_year#24, sum(amount#25)#31 AS sum_profit#32]

(38) Exchange
Input [3]: [nation#23, o_year#24, sum_profit#32]
Arguments: rangepartitioning(nation#23 ASC NULLS FIRST, o_year#24 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#33]

(39) Sort [codegen id : 8]
Input [3]: [nation#23, o_year#24, sum_profit#32]
Arguments: [nation#23 ASC NULLS FIRST, o_year#24 DESC NULLS LAST], true, 0

