morrySnow commented on code in PR #12483:
URL: https://github.com/apache/doris/pull/12483#discussion_r965934727


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/CostAndEnforcerJob.java:
##########
@@ -184,33 +186,47 @@ public void execute() {
                 curTotalCost -= curNodeCost;
                 curNodeCost = CostCalculator.calculateCost(groupExpression);
                 curTotalCost += curNodeCost;
-                // record map { outputProperty -> outputProperty }, { ANY -> 
outputProperty },
-                recordPropertyAndCost(groupExpression, outputProperty, 
outputProperty, requestChildrenProperty);
-                recordPropertyAndCost(groupExpression, outputProperty, 
PhysicalProperties.ANY, requestChildrenProperty);
 
-                enforce(outputProperty, requestChildrenProperty);
+                // colocate join and bucket shuffle join cannot add enforce to 
satisfy required property.
+                if (enforce(outputProperty, requestChildrenProperty)) {
 
-                if (curTotalCost < context.getCostUpperBound()) {
-                    context.setCostUpperBound(curTotalCost);
+                    // record map { outputProperty -> outputProperty }, { ANY 
-> outputProperty },
+                    recordPropertyAndCost(groupExpression, outputProperty, 
outputProperty, requestChildrenProperty);
+                    recordPropertyAndCost(groupExpression, outputProperty, 
PhysicalProperties.ANY,
+                            requestChildrenProperty);

Review Comment:
   enforce return false means this branch is not work



-- 
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

Reply via email to