[fix](nereids)group by expr may be lost in EliminateGroupByConstant rule (#30274)

This commit is contained in:
starocean999
2024-01-23 19:38:27 +08:00
committed by yiguolei
parent 4af3fd2a2e
commit 2b3e7589b7

View File

@ -67,7 +67,7 @@ public class EliminateGroupByConstant extends OneRewriteRuleFactory {
lit = expression;
}
}
if (slotGroupByExprs.isEmpty() && lit != null && aggregate.getAggregateFunctions().isEmpty()) {
if (slotGroupByExprs.isEmpty() && lit != null) {
slotGroupByExprs.add(lit);
}
return aggregate.withGroupByAndOutput(ImmutableList.copyOf(slotGroupByExprs), outputExprs);