== Physical Plan ==
TakeOrderedAndProject (27)
+- * HashAggregate (26)
   +- Exchange (25)
      +- * HashAggregate (24)
         +- * Project (23)
            +- * BroadcastHashJoin Inner BuildRight (22)
               :- * Project (17)
               :  +- * BroadcastHashJoin Inner BuildRight (16)
               :     :- * Project (10)
               :     :  +- * BroadcastHashJoin Inner BuildRight (9)
               :     :     :- * Filter (3)
               :     :     :  +- * ColumnarToRow (2)
               :     :     :     +- Scan parquet spark_catalog.default.customer (1)
               :     :     +- BroadcastExchange (8)
               :     :        +- * Project (7)
               :     :           +- * Filter (6)
               :     :              +- * ColumnarToRow (5)
               :     :                 +- Scan parquet spark_catalog.default.orders (4)
               :     +- BroadcastExchange (15)
               :        +- * Project (14)
               :           +- * Filter (13)
               :              +- * ColumnarToRow (12)
               :                 +- Scan parquet spark_catalog.default.lineitem (11)
               +- BroadcastExchange (21)
                  +- * Filter (20)
                     +- * ColumnarToRow (19)
                        +- Scan parquet spark_catalog.default.nation (18)


(1) Scan parquet spark_catalog.default.customer
Output [7]: [c_custkey#1, c_name#2, c_address#3, c_nationkey#4, c_phone#5, c_acctbal#6, c_comment#7]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_custkey), IsNotNull(c_nationkey)]
ReadSchema: struct<c_custkey:bigint,c_name:string,c_address:string,c_nationkey:bigint,c_phone:string,c_acctbal:decimal(10,0),c_comment:string>

(2) ColumnarToRow [codegen id : 4]
Input [7]: [c_custkey#1, c_name#2, c_address#3, c_nationkey#4, c_phone#5, c_acctbal#6, c_comment#7]

(3) Filter [codegen id : 4]
Input [7]: [c_custkey#1, c_name#2, c_address#3, c_nationkey#4, c_phone#5, c_acctbal#6, c_comment#7]
Condition : (isnotnull(c_custkey#1) AND isnotnull(c_nationkey#4))

(4) Scan parquet spark_catalog.default.orders
Output [3]: [o_orderkey#8, o_custkey#9, o_orderdate#10]
Batched: true
Location [not included in comparison]/{warehouse_dir}/orders]
PushedFilters: [IsNotNull(o_orderdate), GreaterThanOrEqual(o_orderdate,1993-10-01), LessThan(o_orderdate,1994-01-01), IsNotNull(o_custkey), IsNotNull(o_orderkey)]
ReadSchema: struct<o_orderkey:bigint,o_custkey:bigint,o_orderdate:date>

(5) ColumnarToRow [codegen id : 1]
Input [3]: [o_orderkey#8, o_custkey#9, o_orderdate#10]

(6) Filter [codegen id : 1]
Input [3]: [o_orderkey#8, o_custkey#9, o_orderdate#10]
Condition : ((((isnotnull(o_orderdate#10) AND (o_orderdate#10 >= 1993-10-01)) AND (o_orderdate#10 < 1994-01-01)) AND isnotnull(o_custkey#9)) AND isnotnull(o_orderkey#8))

(7) Project [codegen id : 1]
Output [2]: [o_orderkey#8, o_custkey#9]
Input [3]: [o_orderkey#8, o_custkey#9, o_orderdate#10]

(8) BroadcastExchange
Input [2]: [o_orderkey#8, o_custkey#9]
Arguments: HashedRelationBroadcastMode(List(input[1, bigint, true]),false), [plan_id=1]

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

(10) Project [codegen id : 4]
Output [8]: [c_custkey#1, c_name#2, c_address#3, c_nationkey#4, c_phone#5, c_acctbal#6, c_comment#7, o_orderkey#8]
Input [9]: [c_custkey#1, c_name#2, c_address#3, c_nationkey#4, c_phone#5, c_acctbal#6, c_comment#7, o_orderkey#8, o_custkey#9]

(11) Scan parquet spark_catalog.default.lineitem
Output [4]: [l_orderkey#11, l_extendedprice#12, l_discount#13, l_returnflag#14]
Batched: true
Location [not included in comparison]/{warehouse_dir}/lineitem]
PushedFilters: [IsNotNull(l_returnflag), EqualTo(l_returnflag,R), IsNotNull(l_orderkey)]
ReadSchema: struct<l_orderkey:bigint,l_extendedprice:decimal(10,0),l_discount:decimal(10,0),l_returnflag:string>

(12) ColumnarToRow [codegen id : 2]
Input [4]: [l_orderkey#11, l_extendedprice#12, l_discount#13, l_returnflag#14]

(13) Filter [codegen id : 2]
Input [4]: [l_orderkey#11, l_extendedprice#12, l_discount#13, l_returnflag#14]
Condition : ((isnotnull(l_returnflag#14) AND (l_returnflag#14 = R)) AND isnotnull(l_orderkey#11))

(14) Project [codegen id : 2]
Output [3]: [l_orderkey#11, l_extendedprice#12, l_discount#13]
Input [4]: [l_orderkey#11, l_extendedprice#12, l_discount#13, l_returnflag#14]

(15) BroadcastExchange
Input [3]: [l_orderkey#11, l_extendedprice#12, l_discount#13]
Arguments: HashedRelationBroadcastMode(List(input[0, bigint, true]),false), [plan_id=2]

(16) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [o_orderkey#8]
Right keys [1]: [l_orderkey#11]
Join type: Inner
Join condition: None

(17) Project [codegen id : 4]
Output [9]: [c_custkey#1, c_name#2, c_address#3, c_nationkey#4, c_phone#5, c_acctbal#6, c_comment#7, l_extendedprice#12, l_discount#13]
Input [11]: [c_custkey#1, c_name#2, c_address#3, c_nationkey#4, c_phone#5, c_acctbal#6, c_comment#7, o_orderkey#8, l_orderkey#11, l_extendedprice#12, l_discount#13]

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

(19) ColumnarToRow [codegen id : 3]
Input [2]: [n_nationkey#15, n_name#16]

(20) Filter [codegen id : 3]
Input [2]: [n_nationkey#15, n_name#16]
Condition : isnotnull(n_nationkey#15)

(21) BroadcastExchange
Input [2]: [n_nationkey#15, n_name#16]
Arguments: HashedRelationBroadcastMode(List(input[0, bigint, false]),false), [plan_id=3]

(22) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [c_nationkey#4]
Right keys [1]: [n_nationkey#15]
Join type: Inner
Join condition: None

(23) Project [codegen id : 4]
Output [9]: [c_custkey#1, c_name#2, c_address#3, c_phone#5, c_acctbal#6, c_comment#7, l_extendedprice#12, l_discount#13, n_name#16]
Input [11]: [c_custkey#1, c_name#2, c_address#3, c_nationkey#4, c_phone#5, c_acctbal#6, c_comment#7, l_extendedprice#12, l_discount#13, n_nationkey#15, n_name#16]

(24) HashAggregate [codegen id : 4]
Input [9]: [c_custkey#1, c_name#2, c_address#3, c_phone#5, c_acctbal#6, c_comment#7, l_extendedprice#12, l_discount#13, n_name#16]
Keys [7]: [c_custkey#1, c_name#2, c_acctbal#6, c_phone#5, n_name#16, c_address#3, c_comment#7]
Functions [1]: [partial_sum((l_extendedprice#12 * (1 - l_discount#13)))]
Aggregate Attributes [2]: [sum#17, isEmpty#18]
Results [9]: [c_custkey#1, c_name#2, c_acctbal#6, c_phone#5, n_name#16, c_address#3, c_comment#7, sum#19, isEmpty#20]

(25) Exchange
Input [9]: [c_custkey#1, c_name#2, c_acctbal#6, c_phone#5, n_name#16, c_address#3, c_comment#7, sum#19, isEmpty#20]
Arguments: hashpartitioning(c_custkey#1, c_name#2, c_acctbal#6, c_phone#5, n_name#16, c_address#3, c_comment#7, 5), ENSURE_REQUIREMENTS, [plan_id=4]

(26) HashAggregate [codegen id : 5]
Input [9]: [c_custkey#1, c_name#2, c_acctbal#6, c_phone#5, n_name#16, c_address#3, c_comment#7, sum#19, isEmpty#20]
Keys [7]: [c_custkey#1, c_name#2, c_acctbal#6, c_phone#5, n_name#16, c_address#3, c_comment#7]
Functions [1]: [sum((l_extendedprice#12 * (1 - l_discount#13)))]
Aggregate Attributes [1]: [sum((l_extendedprice#12 * (1 - l_discount#13)))#21]
Results [8]: [c_custkey#1, c_name#2, sum((l_extendedprice#12 * (1 - l_discount#13)))#21 AS revenue#22, c_acctbal#6, n_name#16, c_address#3, c_phone#5, c_comment#7]

(27) TakeOrderedAndProject
Input [8]: [c_custkey#1, c_name#2, revenue#22, c_acctbal#6, n_name#16, c_address#3, c_phone#5, c_comment#7]
Arguments: 20, [revenue#22 DESC NULLS LAST], [c_custkey#1, c_name#2, revenue#22, c_acctbal#6, n_name#16, c_address#3, c_phone#5, c_comment#7]

