[fix](planner)use tupleId of agg node to get its unsigned conjuncts (#21949)
This commit is contained in:
@ -2420,7 +2420,8 @@ public class Analyzer {
|
||||
// constant conjuncts should be push down to all leaf node except agg node.
|
||||
// (see getPredicatesBoundedByGroupbysSourceExpr method)
|
||||
// so we need remove constant conjuncts when expr is not a leaf node.
|
||||
List<Expr> unassigned = getUnassignedConjuncts(node.getTblRefIds());
|
||||
List<Expr> unassigned = getUnassignedConjuncts(
|
||||
node instanceof AggregationNode ? node.getTupleIds() : node.getTblRefIds());
|
||||
if (!node.getChildren().isEmpty() && !(node instanceof AggregationNode)) {
|
||||
unassigned = unassigned.stream()
|
||||
.filter(e -> !e.isConstant()).collect(Collectors.toList());
|
||||
|
||||
@ -2,3 +2,9 @@
|
||||
-- !select1 --
|
||||
1 2
|
||||
|
||||
-- !select2 --
|
||||
1 2
|
||||
|
||||
-- !select3 --
|
||||
1 2
|
||||
|
||||
|
||||
@ -19,4 +19,7 @@
|
||||
sql "SET enable_nereids_planner=true"
|
||||
sql "SET enable_fallback_to_original_planner=false"
|
||||
qt_select1 'select * from (select 1 as a, 2 as b union all select 3, 3) t where a = 1;'
|
||||
sql "SET enable_nereids_planner=false"
|
||||
qt_select2 'select * from (select 1 as a, 2 as b union all select 3, 3) t where a = 1;'
|
||||
qt_select3 'select * from (select 1 as a, 2 as b union select 3, 3) t where a = 1;'
|
||||
}
|
||||
Reference in New Issue
Block a user