Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ public Rule build() {
List<Expression> newBottomHashConjuncts = splitHashConjuncts.get(false);

// split OtherJoinConjuncts.
Map<Boolean, List<Expression>> splitOtherConjunts = splitConjuncts(topJoin.getOtherJoinConjuncts(),
Map<Boolean, List<Expression>> splitOtherConjuncts = splitConjuncts(topJoin.getOtherJoinConjuncts(),
bottomJoin, bottomJoin.getOtherJoinConjuncts());
List<Expression> newTopOtherConjuncts = splitOtherConjunts.get(true);
List<Expression> newBottomOtherConjuncts = splitOtherConjunts.get(false);
List<Expression> newTopOtherConjuncts = splitOtherConjuncts.get(true);
List<Expression> newBottomOtherConjuncts = splitOtherConjuncts.get(false);

if (newBottomHashConjuncts.isEmpty() && newBottomOtherConjuncts.isEmpty()) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public Rule build() {
Set<ExprId> conjunctsIds = topSemiJoin.getConditionExprId();
ContainsType containsType = TransposeSemiJoinLogicalJoinProject.containsChildren(conjunctsIds,
a.getOutputExprIdSet(), b.getOutputExprIdSet());
if (containsType == ContainsType.ALL) {
if (containsType == ContainsType.ALL || containsType == ContainsType.NONE) {
return null;
}
if (containsType == ContainsType.LEFT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import org.apache.doris.nereids.util.Utils;
import org.apache.doris.qe.ConnectContext;

import com.google.common.base.Preconditions;

import java.util.Set;

/**
Expand Down Expand Up @@ -61,7 +59,7 @@ public Rule build() {
Set<ExprId> conjunctsIds = topSemiJoin.getConditionExprId();
ContainsType containsType = containsChildren(conjunctsIds, a.getOutputExprIdSet(),
b.getOutputExprIdSet());
if (containsType == ContainsType.ALL) {
if (containsType == ContainsType.ALL || containsType == ContainsType.NONE) {
return null;
}

Expand Down Expand Up @@ -110,7 +108,7 @@ public Rule build() {
}

enum ContainsType {
LEFT, RIGHT, ALL
LEFT, RIGHT, ALL, NONE
}

/**
Expand All @@ -119,13 +117,14 @@ enum ContainsType {
public static ContainsType containsChildren(Set<ExprId> conjunctsExprIdSet, Set<ExprId> left, Set<ExprId> right) {
boolean containsLeft = Utils.isIntersecting(conjunctsExprIdSet, left);
boolean containsRight = Utils.isIntersecting(conjunctsExprIdSet, right);
Preconditions.checkState(containsLeft || containsRight, "join output must contain child");
if (containsLeft && containsRight) {
return ContainsType.ALL;
} else if (containsLeft) {
return ContainsType.LEFT;
} else {
} else if (containsRight) {
return ContainsType.RIGHT;
} else {
return ContainsType.NONE;
}
}
}