XieJiann commented on code in PR #21747: URL: https://github.com/apache/doris/pull/21747#discussion_r1264815211
########## fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/joinorder/hypergraph/GraphSimplifier.java: ########## @@ -381,12 +385,40 @@ Pair<Statistics, Edge> threeRightJoin(long bitmap1, Edge edge1, long bitmap2, Ed return Pair.of(joinStats, edge); } + private Edge processMissedEdges(int edgeIndex1, int edgeIndex2, Edge edge) { + List<Edge> edges = Lists.newArrayList(edge); + edges.addAll(graph.getEdges().stream() + .filter(e -> e.getIndex() != edgeIndex1 && e.getIndex() != edgeIndex2 Review Comment: This function needs to test all edges. The time complexity is turned from O(n^2) into O(n^3). Does it affect the time of the graph simplified? Or cache the missed edge? ########## fe/fe-core/src/main/java/org/apache/doris/nereids/memo/Group.java: ########## @@ -378,10 +379,15 @@ public boolean isInnerJoinGroup() { Plan plan = getLogicalExpression().getPlan(); if (plan instanceof LogicalJoin && ((LogicalJoin) plan).getJoinType() == JoinType.INNER_JOIN) { - // Right now, we only support inner join Preconditions.checkArgument(!((LogicalJoin) plan).getExpressions().isEmpty(), "inner join must have join conjuncts"); - return true; + if (((LogicalJoin) plan).getHashJoinConjuncts().isEmpty() + && ((LogicalJoin) plan).getOtherJoinConjuncts().get(0) instanceof Literal) { + return false; + } else { + // Right now, we only support inner join with some conjuncts referencing any side of the child's output + return true; + } Review Comment: The else is redundant. The follow format is better ``` if (xxx) { return true; } return false; ``` -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org