diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowExpression.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowExpression.java index fce111cae39505..5bea07fff00326 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowExpression.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowExpression.java @@ -152,6 +152,9 @@ public WindowExpression withChildren(List children) { if (index < children.size()) { return new WindowExpression(func, partitionKeys, orderKeys, (WindowFrame) children.get(index)); } + if (windowFrame.isPresent()) { + return new WindowExpression(func, partitionKeys, orderKeys, windowFrame.get()); + } return new WindowExpression(func, partitionKeys, orderKeys); }