[fix](Nereids): TransposeSemiJoinAgg can't apply in Scalar Agg (#28434)
Scalar Agg shouldn't be pushdown, it will cause wrong result
This commit is contained in:
@ -51,6 +51,10 @@ public class TransposeSemiJoinAgg extends OneRewriteRuleFactory {
|
||||
public static boolean canTranspose(LogicalAggregate<? extends Plan> aggregate,
|
||||
LogicalJoin<? extends Plan, ? extends Plan> join) {
|
||||
Set<Slot> canPushDownSlots = PushDownFilterThroughAggregation.getCanPushDownSlots(aggregate);
|
||||
// avoid push down scalar agg.
|
||||
if (canPushDownSlots.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
Set<Slot> leftConditionSlot = join.getLeftConditionSlot();
|
||||
return canPushDownSlots.containsAll(leftConditionSlot);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user