forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[opt](Nereids) remove group by key eliminate rule option (apache#32238)
- Loading branch information
Showing
5 changed files
with
417 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
164 changes: 164 additions & 0 deletions
164
regression-test/data/nereids_rules_p0/eliminate_gby_key/eliminate_gby_key.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !1 -- | ||
cost = 12.09 | ||
PhysicalResultSink[358] ( outputExprs=[t2_c1#10] ) | ||
+--PhysicalDistribute[355]@7 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[352]@7 ( stats=1, projects=[c1#13 AS `t2_c1`#10] ) | ||
+--PhysicalHashAggregate[349]@6 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18], outputExpr=[c1#13, c3#18], partitionExpr=Optional[[c1#13, c3#18]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18]], exprIdToEquivalenceSet={13=0, 18=1} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[346]@5 ( stats=1, projects=[c1#13, c3#18] ) | ||
+--PhysicalHashJoin[343]@4 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalProject[333]@1 ( stats=1, projects=[c1#13, c3#15] ) | ||
| +--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[340]@3 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[337]@3 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@2 ( stats=1 ) | ||
|
||
-- !2 -- | ||
cost = 11.09 | ||
PhysicalResultSink[334] ( outputExprs=[t2_c2#9] ) | ||
+--PhysicalDistribute[331]@6 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[328]@6 ( stats=1, projects=[t2_c2#19 AS `t2_c2`#9] ) | ||
+--PhysicalHashAggregate[325]@5 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18, t2_c2#19], outputExpr=[c1#13, c3#18, t2_c2#19], partitionExpr=Optional[[c1#13, c3#18, t2_c2#19]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18, 19], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18], [19]], exprIdToEquivalenceSet={13=0, 18=1, 19=2} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[322]@4 ( stats=1, projects=[substring(c2#14, 1, 3) AS `t2_c2`#19, c1#13, c3#18] ) | ||
+--PhysicalHashJoin[319]@3 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[316]@2 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[313]@2 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@1 ( stats=1 ) | ||
|
||
-- !3 -- | ||
cost = 12.09 | ||
PhysicalResultSink[358] ( outputExprs=[c3#11] ) | ||
+--PhysicalDistribute[355]@7 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[352]@7 ( stats=1, projects=[c3#18 AS `c3`#11] ) | ||
+--PhysicalHashAggregate[349]@6 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18], outputExpr=[c1#13, c3#18], partitionExpr=Optional[[c1#13, c3#18]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18]], exprIdToEquivalenceSet={13=0, 18=1} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[346]@5 ( stats=1, projects=[c1#13, c3#18] ) | ||
+--PhysicalHashJoin[343]@4 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalProject[333]@1 ( stats=1, projects=[c1#13, c3#15] ) | ||
| +--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[340]@3 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[337]@3 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@2 ( stats=1 ) | ||
|
||
-- !4 -- | ||
cost = 12.09 | ||
PhysicalResultSink[358] ( outputExprs=[cnt#12] ) | ||
+--PhysicalDistribute[355]@7 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[352]@7 ( stats=1, projects=[cnt#20 AS `cnt`#12] ) | ||
+--PhysicalHashAggregate[349]@6 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18], outputExpr=[c1#13, c3#18, count(*) AS `cnt`#20], partitionExpr=Optional[[c1#13, c3#18]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18]], exprIdToEquivalenceSet={13=0, 18=1} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[346]@5 ( stats=1, projects=[c1#13, c3#18] ) | ||
+--PhysicalHashJoin[343]@4 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalProject[333]@1 ( stats=1, projects=[c1#13, c3#15] ) | ||
| +--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[340]@3 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[337]@3 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@2 ( stats=1 ) | ||
|
||
-- !5 -- | ||
cost = 11.09 | ||
PhysicalResultSink[334] ( outputExprs=[t2_c2#9, t2_c1#10] ) | ||
+--PhysicalDistribute[331]@6 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[328]@6 ( stats=1, projects=[t2_c2#19 AS `t2_c2`#9, c1#13 AS `t2_c1`#10] ) | ||
+--PhysicalHashAggregate[325]@5 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18, t2_c2#19], outputExpr=[c1#13, c3#18, t2_c2#19], partitionExpr=Optional[[c1#13, c3#18, t2_c2#19]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18, 19], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18], [19]], exprIdToEquivalenceSet={13=0, 18=1, 19=2} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[322]@4 ( stats=1, projects=[substring(c2#14, 1, 3) AS `t2_c2`#19, c1#13, c3#18] ) | ||
+--PhysicalHashJoin[319]@3 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[316]@2 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[313]@2 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@1 ( stats=1 ) | ||
|
||
-- !6 -- | ||
cost = 12.09 | ||
PhysicalResultSink[358] ( outputExprs=[c3#11, t2_c1#10] ) | ||
+--PhysicalDistribute[355]@7 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[352]@7 ( stats=1, projects=[c3#18 AS `c3`#11, c1#13 AS `t2_c1`#10] ) | ||
+--PhysicalHashAggregate[349]@6 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18], outputExpr=[c1#13, c3#18], partitionExpr=Optional[[c1#13, c3#18]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18]], exprIdToEquivalenceSet={13=0, 18=1} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[346]@5 ( stats=1, projects=[c1#13, c3#18] ) | ||
+--PhysicalHashJoin[343]@4 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalProject[333]@1 ( stats=1, projects=[c1#13, c3#15] ) | ||
| +--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[340]@3 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[337]@3 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@2 ( stats=1 ) | ||
|
||
-- !7 -- | ||
cost = 11.09 | ||
PhysicalResultSink[334] ( outputExprs=[c3#11, t2_c2#9] ) | ||
+--PhysicalDistribute[331]@6 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[328]@6 ( stats=1, projects=[c3#18 AS `c3`#11, t2_c2#19 AS `t2_c2`#9] ) | ||
+--PhysicalHashAggregate[325]@5 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18, t2_c2#19], outputExpr=[c1#13, c3#18, t2_c2#19], partitionExpr=Optional[[c1#13, c3#18, t2_c2#19]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18, 19], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18], [19]], exprIdToEquivalenceSet={13=0, 18=1, 19=2} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[322]@4 ( stats=1, projects=[substring(c2#14, 1, 3) AS `t2_c2`#19, c1#13, c3#18] ) | ||
+--PhysicalHashJoin[319]@3 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[316]@2 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[313]@2 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@1 ( stats=1 ) | ||
|
||
-- !8 -- | ||
cost = 12.09 | ||
PhysicalResultSink[358] ( outputExprs=[t2_c1#10, cnt#12] ) | ||
+--PhysicalDistribute[355]@7 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[352]@7 ( stats=1, projects=[c1#13 AS `t2_c1`#10, cnt#20 AS `cnt`#12] ) | ||
+--PhysicalHashAggregate[349]@6 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18], outputExpr=[c1#13, c3#18, count(*) AS `cnt`#20], partitionExpr=Optional[[c1#13, c3#18]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18]], exprIdToEquivalenceSet={13=0, 18=1} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[346]@5 ( stats=1, projects=[c1#13, c3#18] ) | ||
+--PhysicalHashJoin[343]@4 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalProject[333]@1 ( stats=1, projects=[c1#13, c3#15] ) | ||
| +--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[340]@3 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[337]@3 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@2 ( stats=1 ) | ||
|
||
-- !9 -- | ||
cost = 12.09 | ||
PhysicalResultSink[358] ( outputExprs=[c3#11, cnt#12] ) | ||
+--PhysicalDistribute[355]@7 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[352]@7 ( stats=1, projects=[c3#18 AS `c3`#11, cnt#20 AS `cnt`#12] ) | ||
+--PhysicalHashAggregate[349]@6 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18], outputExpr=[c1#13, c3#18, count(*) AS `cnt`#20], partitionExpr=Optional[[c1#13, c3#18]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18]], exprIdToEquivalenceSet={13=0, 18=1} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[346]@5 ( stats=1, projects=[c1#13, c3#18] ) | ||
+--PhysicalHashJoin[343]@4 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalProject[333]@1 ( stats=1, projects=[c1#13, c3#15] ) | ||
| +--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[340]@3 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[337]@3 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@2 ( stats=1 ) | ||
|
||
-- !10 -- | ||
cost = 12.09 | ||
PhysicalResultSink[358] ( outputExprs=[t2_c1#10, c3#11, cnt#12] ) | ||
+--PhysicalDistribute[355]@7 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[352]@7 ( stats=1, projects=[c1#13 AS `t2_c1`#10, c3#18 AS `c3`#11, cnt#20 AS `cnt`#12] ) | ||
+--PhysicalHashAggregate[349]@6 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18], outputExpr=[c1#13, c3#18, count(*) AS `cnt`#20], partitionExpr=Optional[[c1#13, c3#18]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18]], exprIdToEquivalenceSet={13=0, 18=1} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[346]@5 ( stats=1, projects=[c1#13, c3#18] ) | ||
+--PhysicalHashJoin[343]@4 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalProject[333]@1 ( stats=1, projects=[c1#13, c3#15] ) | ||
| +--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[340]@3 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[337]@3 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@2 ( stats=1 ) | ||
|
||
-- !11 -- | ||
cost = 11.09 | ||
PhysicalResultSink[332] ( outputExprs=[t2_c2#9, c3#11, t2_c1#10] ) | ||
+--PhysicalDistribute[329]@6 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[326]@6 ( stats=1, projects=[t2_c2#19 AS `t2_c2`#9, c3#18 AS `c3`#11, c1#13 AS `t2_c1`#10] ) | ||
+--PhysicalHashAggregate[323]@5 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18, t2_c2#19], outputExpr=[c1#13, c3#18, t2_c2#19], partitionExpr=Optional[[c1#13, c3#18, t2_c2#19]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18, 19], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18], [19]], exprIdToEquivalenceSet={13=0, 18=1, 19=2} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[320]@4 ( stats=1, projects=[substring(c2#14, 1, 3) AS `t2_c2`#19, c1#13, c3#18] ) | ||
+--PhysicalHashJoin[317]@3 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[314]@2 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[311]@2 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@1 ( stats=1 ) | ||
|
||
-- !12 -- | ||
cost = 11.09 | ||
PhysicalResultSink[330] ( outputExprs=[t2_c2#9, c3#11, t2_c1#10, cnt#12] ) | ||
+--PhysicalDistribute[327]@6 ( stats=1, distributionSpec=DistributionSpecGather ) | ||
+--PhysicalProject[324]@6 ( stats=1, projects=[t2_c2#19 AS `t2_c2`#9, c3#18 AS `c3`#11, c1#13 AS `t2_c1`#10, cnt#20 AS `cnt`#12] ) | ||
+--PhysicalHashAggregate[321]@5 ( aggPhase=LOCAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[c1#13, c3#18, t2_c2#19], outputExpr=[c1#13, c3#18, t2_c2#19, count(*) AS `cnt`#20], partitionExpr=Optional[[c1#13, c3#18, t2_c2#19]], requireProperties=[DistributionSpecHash ( orderedShuffledColumns=[13, 18, 19], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[13], [18], [19]], exprIdToEquivalenceSet={13=0, 18=1, 19=2} ) Order: ([])], stats=1 ) | ||
+--PhysicalProject[318]@4 ( stats=1, projects=[substring(c2#14, 1, 3) AS `t2_c2`#19, c1#13, c3#18] ) | ||
+--PhysicalHashJoin[315]@3 ( type=INNER_JOIN, stats=1, hashCondition=[(c3#15 = c2#17)], otherCondition=[], markCondition=[] ) | ||
|--PhysicalOlapScan[t2]@0 ( stats=1 ) | ||
+--PhysicalDistribute[312]@2 ( stats=1, distributionSpec=DistributionSpecReplicated ) | ||
+--PhysicalProject[309]@2 ( stats=1, projects=[c2#17, c3#18] ) | ||
+--PhysicalOlapScan[t1]@1 ( stats=1 ) | ||
|
Oops, something went wrong.