Skip to content

Commit

Permalink
[fix](Nereids) colocate join could not work well on full outer join (#…
Browse files Browse the repository at this point in the history
…24700)

in previous PR #22979, we fix the output deriver of join. But we forgot
to change the util method JoinUtils#shouldColocateJoin to adjust the
change of physical properties derive.
we could not use join distribution type anymore since join could output
any distribute for full outer join.
  • Loading branch information
morrySnow authored and xiaokang committed Sep 21, 2023
1 parent c916925 commit be3d31e
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,21 +225,14 @@ public static boolean shouldColocateJoin(AbstractPhysicalJoin<PhysicalPlan, Phys
|| ConnectContext.get().getSessionVariable().isDisableColocatePlan()) {
return false;
}
// TODO: not rely on physical properties?
DistributionSpec joinDistributionSpec = join.getPhysicalProperties().getDistributionSpec();
DistributionSpec leftDistributionSpec = join.left().getPhysicalProperties().getDistributionSpec();
DistributionSpec rightDistributionSpec = join.right().getPhysicalProperties().getDistributionSpec();
if (!(leftDistributionSpec instanceof DistributionSpecHash)
|| !(rightDistributionSpec instanceof DistributionSpecHash)
|| !(joinDistributionSpec instanceof DistributionSpecHash)) {
|| !(rightDistributionSpec instanceof DistributionSpecHash)) {
return false;
}
DistributionSpecHash leftHash = (DistributionSpecHash) leftDistributionSpec;
DistributionSpecHash rightHash = (DistributionSpecHash) rightDistributionSpec;
DistributionSpecHash joinHash = (DistributionSpecHash) joinDistributionSpec;
return leftHash.getShuffleType() == ShuffleType.NATURAL
&& rightHash.getShuffleType() == ShuffleType.NATURAL
&& joinHash.getShuffleType() == ShuffleType.NATURAL;
return couldColocateJoin((DistributionSpecHash) leftDistributionSpec,
(DistributionSpecHash) rightDistributionSpec);
}

/**
Expand Down

0 comments on commit be3d31e

Please sign in to comment.