[fix](mark join) mark join column should be nullable (#24910)

This commit is contained in:
Jerry Hu
2023-10-09 21:10:36 -05:00
committed by GitHub
parent e2be5fafa9
commit f5b826b66d
17 changed files with 244 additions and 97 deletions

View File

@ -29,17 +29,17 @@ public class MarkJoinSlotReference extends SlotReference implements SlotNotFromC
final boolean existsHasAgg;
public MarkJoinSlotReference(String name) {
super(name, BooleanType.INSTANCE, false);
super(name, BooleanType.INSTANCE, true);
this.existsHasAgg = false;
}
public MarkJoinSlotReference(String name, boolean existsHasAgg) {
super(name, BooleanType.INSTANCE, false);
super(name, BooleanType.INSTANCE, true);
this.existsHasAgg = existsHasAgg;
}
public MarkJoinSlotReference(ExprId exprId, String name, boolean existsHasAgg) {
super(exprId, name, BooleanType.INSTANCE, false, ImmutableList.of());
super(exprId, name, BooleanType.INSTANCE, true, ImmutableList.of());
this.existsHasAgg = existsHasAgg;
}

View File

@ -53,7 +53,8 @@ import java.util.stream.Collectors;
public class JoinUtils {
public static boolean couldShuffle(Join join) {
// Cross-join and Null-Aware-Left-Anti-Join only can be broadcast join.
return !(join.getJoinType().isCrossJoin()) && !(join.getJoinType().isNullAwareLeftAntiJoin());
// Because mark join would consider null value from both build and probe side, so must use broadcast join too.
return !(join.getJoinType().isCrossJoin() || join.getJoinType().isNullAwareLeftAntiJoin() || join.isMarkJoin());
}
public static boolean couldBroadcast(Join join) {