feiniaofeiafei commented on code in PR #54079:
URL: https://github.com/apache/doris/pull/54079#discussion_r2303324306
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/properties/RequestPropertyDeriver.java:
##########
@@ -413,6 +415,52 @@ public Void visitPhysicalWindow(PhysicalWindow<? extends
Plan> window, PlanConte
return null;
}
+ @Override
+ public Void visitPhysicalHashAggregate(PhysicalHashAggregate<? extends
Plan> agg, PlanContext context) {
+ // 先在这里实现一下
+ // group by a,b
+ // 如果agg收到的请求是a,agg发出的请求是a,b,a是a,b的子集,
那么agg发送a请求给孩子(这里判断一下a的ndv,如果很小的话就还是发a,b)
+ // 如果agg没有收到请求,那还是发出a,b
+ // 如果agg收到了请求,但是没有交集,那么agg仍然发出a,b
+ // 如果是local agg,那么发出any, 如果是global agg,才有要求
+ DistributionSpec parentDist =
requestPropertyFromParent.getDistributionSpec();
+ if (agg.getAggPhase().isLocal()) {
+ addRequestPropertyToChildren(PhysicalProperties.ANY);
+ return null;
+ } else if (agg.getAggPhase().isGlobal()) {
+ if (agg.getPartitionExpressions().isPresent() &&
!agg.getPartitionExpressions().get().isEmpty()) {
Review Comment:
if PartitionExpressions exist in agg, should use PartitionExpressions as
hash distribution request; if not exists, we need compute hash distribution
request in this functions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]