Dandandan commented on code in PR #21240:
URL: https://github.com/apache/datafusion/pull/21240#discussion_r3012937462
##########
datafusion/sqllogictest/test_files/tpch/plans/q22.slt.part:
##########
@@ -61,40 +61,41 @@ logical_plan
03)----Aggregate: groupBy=[[custsale.cntrycode]], aggr=[[count(Int64(1)),
sum(custsale.c_acctbal)]]
04)------SubqueryAlias: custsale
05)--------Projection: substr(customer.c_phone, Int64(1), Int64(2)) AS
cntrycode, customer.c_acctbal
-06)----------Inner Join: Filter: CAST(customer.c_acctbal AS Decimal128(19,
6)) > __scalar_sq_2.avg(customer.c_acctbal)
-07)------------Projection: customer.c_phone, customer.c_acctbal
-08)--------------LeftAnti Join: customer.c_custkey =
__correlated_sq_1.o_custkey
-09)----------------Filter: substr(customer.c_phone, Int64(1), Int64(2)) IN
([Utf8View("13"), Utf8View("31"), Utf8View("23"), Utf8View("29"),
Utf8View("30"), Utf8View("18"), Utf8View("17")])
-10)------------------TableScan: customer projection=[c_custkey, c_phone,
c_acctbal], partial_filters=[substr(customer.c_phone, Int64(1), Int64(2)) IN
([Utf8View("13"), Utf8View("31"), Utf8View("23"), Utf8View("29"),
Utf8View("30"), Utf8View("18"), Utf8View("17")]), Boolean(true)]
-11)----------------SubqueryAlias: __correlated_sq_1
-12)------------------TableScan: orders projection=[o_custkey]
-13)------------SubqueryAlias: __scalar_sq_2
-14)--------------Aggregate: groupBy=[[]], aggr=[[avg(customer.c_acctbal)]]
-15)----------------Projection: customer.c_acctbal
-16)------------------Filter: customer.c_acctbal > Decimal128(Some(0),15,2) AND
substr(customer.c_phone, Int64(1), Int64(2)) IN ([Utf8View("13"),
Utf8View("31"), Utf8View("23"), Utf8View("29"), Utf8View("30"), Utf8View("18"),
Utf8View("17")])
-17)--------------------TableScan: customer projection=[c_phone, c_acctbal],
partial_filters=[customer.c_acctbal > Decimal128(Some(0),15,2),
substr(customer.c_phone, Int64(1), Int64(2)) IN ([Utf8View("13"),
Utf8View("31"), Utf8View("23"), Utf8View("29"), Utf8View("30"), Utf8View("18"),
Utf8View("17")])]
+06)----------LeftAnti Join: customer.c_custkey = __correlated_sq_1.o_custkey
+07)------------Filter: substr(customer.c_phone, Int64(1), Int64(2)) IN
([Utf8View("13"), Utf8View("31"), Utf8View("23"), Utf8View("29"),
Utf8View("30"), Utf8View("18"), Utf8View("17")]) AND CAST(customer.c_acctbal AS
Decimal128(19, 6)) > (<subquery>)
+08)--------------Subquery:
+09)----------------Aggregate: groupBy=[[]], aggr=[[avg(customer.c_acctbal)]]
+10)------------------Projection: customer.c_acctbal
+11)--------------------Filter: customer.c_acctbal > Decimal128(Some(0),15,2)
AND substr(customer.c_phone, Int64(1), Int64(2)) IN ([Utf8View("13"),
Utf8View("31"), Utf8View("23"), Utf8View("29"), Utf8View("30"), Utf8View("18"),
Utf8View("17")])
+12)----------------------TableScan: customer projection=[c_phone, c_acctbal],
partial_filters=[customer.c_acctbal > Decimal128(Some(0),15,2),
substr(customer.c_phone, Int64(1), Int64(2)) IN ([Utf8View("13"),
Utf8View("31"), Utf8View("23"), Utf8View("29"), Utf8View("30"), Utf8View("18"),
Utf8View("17")])]
+13)--------------TableScan: customer projection=[c_custkey, c_phone,
c_acctbal], partial_filters=[substr(customer.c_phone, Int64(1), Int64(2)) IN
([Utf8View("13"), Utf8View("31"), Utf8View("23"), Utf8View("29"),
Utf8View("30"), Utf8View("18"), Utf8View("17")]), CAST(customer.c_acctbal AS
Decimal128(19, 6)) > (<subquery>)]
+14)----------------Subquery:
+15)------------------Aggregate: groupBy=[[]], aggr=[[avg(customer.c_acctbal)]]
+16)--------------------Projection: customer.c_acctbal
+17)----------------------Filter: customer.c_acctbal > Decimal128(Some(0),15,2)
AND substr(customer.c_phone, Int64(1), Int64(2)) IN ([Utf8View("13"),
Utf8View("31"), Utf8View("23"), Utf8View("29"), Utf8View("30"), Utf8View("18"),
Utf8View("17")])
+18)------------------------TableScan: customer projection=[c_phone,
c_acctbal], partial_filters=[customer.c_acctbal > Decimal128(Some(0),15,2),
substr(customer.c_phone, Int64(1), Int64(2)) IN ([Utf8View("13"),
Utf8View("31"), Utf8View("23"), Utf8View("29"), Utf8View("30"), Utf8View("18"),
Utf8View("17")])]
+19)------------SubqueryAlias: __correlated_sq_1
+20)--------------TableScan: orders projection=[o_custkey]
physical_plan
-01)SortPreservingMergeExec: [cntrycode@0 ASC NULLS LAST]
-02)--SortExec: expr=[cntrycode@0 ASC NULLS LAST], preserve_partitioning=[true]
-03)----ProjectionExec: expr=[cntrycode@0 as cntrycode, count(Int64(1))@1 as
numcust, sum(custsale.c_acctbal)@2 as totacctbal]
-04)------AggregateExec: mode=FinalPartitioned, gby=[cntrycode@0 as cntrycode],
aggr=[count(Int64(1)), sum(custsale.c_acctbal)]
-05)--------RepartitionExec: partitioning=Hash([cntrycode@0], 4),
input_partitions=4
-06)----------AggregateExec: mode=Partial, gby=[cntrycode@0 as cntrycode],
aggr=[count(Int64(1)), sum(custsale.c_acctbal)]
-07)------------ProjectionExec: expr=[substr(c_phone@0, 1, 2) as cntrycode,
c_acctbal@1 as c_acctbal]
-08)--------------RepartitionExec: partitioning=RoundRobinBatch(4),
input_partitions=1
-09)----------------NestedLoopJoinExec: join_type=Inner,
filter=join_proj_push_down_1@1 > avg(customer.c_acctbal)@0,
projection=[c_phone@0, c_acctbal@1, avg(customer.c_acctbal)@3]
-10)------------------ProjectionExec: expr=[c_phone@0 as c_phone, c_acctbal@1
as c_acctbal, CAST(c_acctbal@1 AS Decimal128(19, 6)) as join_proj_push_down_1]
-11)--------------------CoalescePartitionsExec
-12)----------------------HashJoinExec: mode=Partitioned, join_type=LeftAnti,
on=[(c_custkey@0, o_custkey@0)], projection=[c_phone@1, c_acctbal@2]
-13)------------------------RepartitionExec: partitioning=Hash([c_custkey@0],
4), input_partitions=4
-14)--------------------------FilterExec: substr(c_phone@1, 1, 2) IN (SET)
([13, 31, 23, 29, 30, 18, 17])
-15)----------------------------RepartitionExec:
partitioning=RoundRobinBatch(4), input_partitions=1
-16)------------------------------DataSourceExec: file_groups={1 group:
[[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/tpch/data/customer.tbl]]},
projection=[c_custkey, c_phone, c_acctbal], file_type=csv, has_header=false
-17)------------------------RepartitionExec: partitioning=Hash([o_custkey@0],
4), input_partitions=4
-18)--------------------------DataSourceExec: file_groups={4 groups:
[[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/tpch/data/orders.tbl:0..4223281],
[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/tpch/data/orders.tbl:4223281..8446562],
[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/tpch/data/orders.tbl:8446562..12669843],
[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/tpch/data/orders.tbl:12669843..16893122]]},
projection=[o_custkey], file_type=csv, has_header=false
-19)------------------AggregateExec: mode=Final, gby=[],
aggr=[avg(customer.c_acctbal)]
-20)--------------------CoalescePartitionsExec
-21)----------------------AggregateExec: mode=Partial, gby=[],
aggr=[avg(customer.c_acctbal)]
-22)------------------------FilterExec: c_acctbal@1 > Some(0),15,2 AND
substr(c_phone@0, 1, 2) IN (SET) ([13, 31, 23, 29, 30, 18, 17]),
projection=[c_acctbal@1]
-23)--------------------------RepartitionExec: partitioning=RoundRobinBatch(4),
input_partitions=1
-24)----------------------------DataSourceExec: file_groups={1 group:
[[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/tpch/data/customer.tbl]]},
projection=[c_phone, c_acctbal], file_type=csv, has_header=false
+01)ScalarSubqueryExec: subqueries=1
+02)--RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1,
maintains_sort_order=true
Review Comment:
RepartitionExec seems not useful here?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]