[fix](planner) Fix agg on inlineview which with constant slot (#18201)
Since slot that reference to constant has been marked as constant expr either, just add condition check to make sure such slot wouldn't be eliminated as constant from group exprs
This commit is contained in:
@ -1387,7 +1387,7 @@ public class SelectStmt extends QueryStmt {
|
||||
for (Expr groupExpr : groupingExprs) {
|
||||
//remove groupExpr if it is const, and it is not in select list
|
||||
boolean removeConstGroupingKey = false;
|
||||
if (groupExpr.isConstant()) {
|
||||
if (groupExpr.isConstant() && !(groupExpr.contains(e -> e instanceof SlotRef))) {
|
||||
if (theFirstConstantGroupingExpr == null) {
|
||||
theFirstConstantGroupingExpr = groupExpr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user