diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalProject.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalProject.java index 63845a87db23ad..612231340f16ed 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalProject.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalProject.java @@ -245,9 +245,12 @@ public void computeUniform(DataTrait.Builder builder) { builder.addUniformSlotAndLiteral(proj.toSlot(), proj.child(0)); } else if (proj.child(0) instanceof Slot) { Slot slot = (Slot) proj.child(0); - if (child(0).getLogicalProperties().getTrait().isUniformAndHasConstValue(slot)) { + DataTrait childTrait = child(0).getLogicalProperties().getTrait(); + if (childTrait.isUniformAndHasConstValue(slot)) { builder.addUniformSlotAndLiteral(proj.toSlot(), child(0).getLogicalProperties().getTrait().getUniformValue(slot).get()); + } else if (childTrait.isUniform(slot)) { + builder.addUniformSlot(proj.toSlot()); } } }