seawinde commented on code in PR #50895:
URL: https://github.com/apache/doris/pull/50895#discussion_r2224689138
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/memo/Memo.java:
##########
@@ -207,6 +215,30 @@ public Pair<Integer, Integer> countGroupJoin(Group group) {
return Pair.of(continuousJoinCount, Math.max(continuousJoinCount,
maxJoinCount));
}
+ private static Pair<Integer, Integer> countLogicalJoin(Plan plan) {
+ List<Pair<Integer, Integer>> children = new ArrayList<>();
+ for (Plan child : plan.children()) {
+ children.add(countLogicalJoin(child));
+ }
+ if (plan instanceof LogicalProject) {
+ return children.get(0);
+ }
+ int maxJoinCount = 0;
+ int continuousJoinCount = 0;
+ for (Pair<Integer, Integer> child : children) {
+ maxJoinCount = Math.max(maxJoinCount, child.second);
+ }
+ if (plan instanceof LogicalJoin) {
+ for (Pair<Integer, Integer> child : children) {
+ continuousJoinCount += child.first;
+ }
+ continuousJoinCount += 1;
+ } else if (plan instanceof LogicalProject) {
+ return children.get(0);
+ }
Review Comment:
yeah, this branch should be removed
--
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]