XieJiann commented on code in PR #22979:
URL: https://github.com/apache/doris/pull/22979#discussion_r1294157586
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildOutputPropertyDeriver.java:
##########
@@ -239,18 +239,28 @@ public PhysicalProperties visitPhysicalHashJoin(
DistributionSpecHash leftHashSpec = (DistributionSpecHash)
leftOutputProperty.getDistributionSpec();
DistributionSpecHash rightHashSpec = (DistributionSpecHash)
rightOutputProperty.getDistributionSpec();
- // colocate join
- if (leftHashSpec.getShuffleType() == ShuffleType.NATURAL
- && rightHashSpec.getShuffleType() == ShuffleType.NATURAL) {
- if (JoinUtils.couldColocateJoin(leftHashSpec, rightHashSpec)) {
- return new
PhysicalProperties(DistributionSpecHash.merge(leftHashSpec, rightHashSpec));
- }
+ switch (hashJoin.getJoinType()) {
+ case INNER_JOIN:
+ case CROSS_JOIN:
+ return new PhysicalProperties(DistributionSpecHash.merge(
+ leftHashSpec, rightHashSpec,
leftHashSpec.getShuffleType()));
+ case LEFT_SEMI_JOIN:
+ case LEFT_ANTI_JOIN:
+ case NULL_AWARE_LEFT_ANTI_JOIN:
+ case LEFT_OUTER_JOIN:
+ return new PhysicalProperties(leftHashSpec);
+ case RIGHT_SEMI_JOIN:
+ case RIGHT_ANTI_JOIN:
+ case RIGHT_OUTER_JOIN:
+ return new PhysicalProperties(rightHashSpec);
+ case FULL_OUTER_JOIN:
+ return PhysicalProperties.ANY;
+ default:
+ throw new AnalysisException("unknown join type " +
hashJoin.getJoinType());
}
-
// shuffle, if left child is natural mean current join is bucket
shuffle join
// and remain natural for colocate join on upper join.
Review Comment:
This comment 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]