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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/copier/LogicalPlanDeepCopier.java:
##########
@@ -412,4 +426,24 @@ private void updateReplaceMapWithOutput(Plan oldPlan, Plan 
newPlan, Map<ExprId,
         }
     }
 
+    private Plan updateOperativeSlots(LogicalCatalogRelation oldRelation, 
LogicalCatalogRelation newRelation) {
+        List<Slot> oldOperativeSlots = oldRelation.getOperativeSlots();
+        List<Slot> newOperativeSlots = new 
ArrayList<>(oldOperativeSlots.size());
+        int outputSize = oldOperativeSlots.size();
+        for (Slot opSlot : oldOperativeSlots) {
+            int idx;
+            for (idx = 0; idx < outputSize; idx++) {
+                if (opSlot.equals(oldRelation.getOutput().get(idx))) {
+                    newOperativeSlots.add(newRelation.getOutput().get(idx));
+                    break;
+                }
+            }

Review Comment:
   maybe use `ExpressionDeepCopier.INSTANCE.deepCopy(opSlot, context)` is a 
better way



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

Reply via email to