HappenLee commented on code in PR #67805:
URL: https://github.com/apache/doris/pull/67805#discussion_r3995346772
##########
be/src/exprs/aggregate/aggregate_function_topn.h:
##########
@@ -85,8 +86,15 @@ struct AggregateFunctionTopNData {
return;
}
- top_num = rhs.top_num;
- capacity = rhs.capacity;
+ if (!top_num) {
Review Comment:
Updated in 822f212f89ec6da1f13f6abe13f4df6a47f77b2b: an empty TopN counter
map does not contribute to merging, including when serialization retains zero
elements because capacity is zero. Merge handles empty maps before comparing
N/capacity or adjusting full-map counts; an empty destination adopts the
contributing source. This supersedes the earlier configured-empty policy.
All three TopN variants are covered in both operand orders and through
serialization/SQL merge-union paths. Historical trial-state migration remains
outside scope; no initialization tag is needed for this empty-payload rule.
--
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]