jackwener commented on code in PR #4465:
URL: https://github.com/apache/arrow-datafusion/pull/4465#discussion_r1118027719


##########
benchmarks/expected-plans/q11.txt:
##########
@@ -3,18 +3,24 @@ Sort: value DESC NULLS FIRST
     Filter: CAST(SUM(partsupp.ps_supplycost * partsupp.ps_availqty) AS 
Decimal128(38, 15)) > CAST(__scalar_sq_1.__value AS Decimal128(38, 15))
       CrossJoin:
         Aggregate: groupBy=[[partsupp.ps_partkey]], 
aggr=[[SUM(CAST(partsupp.ps_supplycost AS Decimal128(26, 2)) * 
CAST(partsupp.ps_availqty AS Decimal128(26, 2)))]]
-          Inner Join: supplier.s_nationkey = nation.n_nationkey
-            Inner Join: partsupp.ps_suppkey = supplier.s_suppkey
-              TableScan: partsupp projection=[ps_partkey, ps_suppkey, 
ps_availqty, ps_supplycost]
-              TableScan: supplier projection=[s_suppkey, s_nationkey]
-            Filter: nation.n_name = Utf8("GERMANY")
-              TableScan: nation projection=[n_nationkey, n_name]
-        SubqueryAlias: __scalar_sq_1
-          Projection: CAST(SUM(partsupp.ps_supplycost * partsupp.ps_availqty) 
AS Float64) * Float64(0.0001) AS __value
-            Aggregate: groupBy=[[]], aggr=[[SUM(CAST(partsupp.ps_supplycost AS 
Decimal128(26, 2)) * CAST(partsupp.ps_availqty AS Decimal128(26, 2)))]]
-              Inner Join: supplier.s_nationkey = nation.n_nationkey
+          Projection: partsupp.ps_partkey, partsupp.ps_availqty, 
partsupp.ps_supplycost
+            Inner Join: supplier.s_nationkey = nation.n_nationkey
+              Projection: partsupp.ps_partkey, partsupp.ps_availqty, 
partsupp.ps_supplycost, supplier.s_nationkey
                 Inner Join: partsupp.ps_suppkey = supplier.s_suppkey
-                  TableScan: partsupp projection=[ps_suppkey, ps_availqty, 
ps_supplycost]
+                  TableScan: partsupp projection=[ps_partkey, ps_suppkey, 
ps_availqty, ps_supplycost]
                   TableScan: supplier projection=[s_suppkey, s_nationkey]
+              Projection: nation.n_nationkey

Review Comment:
   Here Filter will output two columns, but we just need one column 
`nation.n_nationkey`, so add projection to prune column



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to