morrySnow commented on code in PR #25874: URL: https://github.com/apache/doris/pull/25874#discussion_r1381191283
########## fe/fe-core/src/main/java/org/apache/doris/nereids/trees/copier/ExpressionDeepCopier.java: ########## @@ -64,13 +66,27 @@ public Expression visitAlias(Alias alias, DeepCopierContext context) { @Override public Expression visitSlotReference(SlotReference slotReference, DeepCopierContext context) { Map<ExprId, ExprId> exprIdReplaceMap = context.exprIdReplaceMap; + ExprId newExprId; if (exprIdReplaceMap.containsKey(slotReference.getExprId())) { - ExprId newExprId = exprIdReplaceMap.get(slotReference.getExprId()); - return slotReference.withExprId(newExprId); + newExprId = exprIdReplaceMap.get(slotReference.getExprId()); } else { - SlotReference newOne = new SlotReference(slotReference.getName(), slotReference.getDataType(), - slotReference.nullable(), slotReference.getQualifier()); - exprIdReplaceMap.put(slotReference.getExprId(), newOne.getExprId()); + newExprId = StatementScopeIdGenerator.newExprId(); + exprIdReplaceMap.put(slotReference.getExprId(), newExprId); + } + return slotReference.withExprId(newExprId); + } + + @Override + public Expression visitArrayItemReference(ArrayItemReference arrayItemSlot, DeepCopierContext context) { + Map<ExprId, ExprId> exprIdReplaceMap = context.exprIdReplaceMap; + if (exprIdReplaceMap.containsKey(arrayItemSlot.getExprId())) { + ExprId newExprId = exprIdReplaceMap.get(arrayItemSlot.getExprId()); + return new ArrayItemReference(newExprId, arrayItemSlot.getName(), + arrayItemSlot.getArrayExpression()); Review Comment: do we need rewrite the expression returned by arrayItemSlot.getArrayExpression()? -- 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