HappenLee commented on code in PR #67805:
URL: https://github.com/apache/doris/pull/67805#discussion_r3980249349


##########
be/src/exprs/aggregate/aggregate_function_ema.h:
##########
@@ -86,12 +87,17 @@ struct ExponentialMovingAverageData {
     }
 
     void merge(const ExponentialMovingAverageData& rhs) {
-        double hd = half_decay != 0.0 ? half_decay : rhs.half_decay;
-        if (hd == 0.0) {
+        if (rhs.half_decay == 0.0) {

Review Comment:
   After discussing the intended contract, we will preserve the existing 
zero-half-decay behavior: zero returns 0 and serves as the 
empty/non-contributing state marker. A serialized zero-half-decay state is 
intentionally ignored by `_merge`/`_union`, even if it was built from non-null 
rows. Thus 0 versus a nonzero half-decay does not raise a mismatch; the 
compatibility check applies to contributing states with nonzero half-decays.
   
   I have documented this exception in the function's source comment and a 
local documentation note, and withdrawn the proposed NaN-sentinel 
implementation. This is a clarification of the intended contract rather than a 
change to distinguish an initialized zero configuration. The separate 
NaN-equality concern remains open for discussion.
   
   The documentation-only change passed formatting, header-hygiene, and 
whitespace checks. Runtime tests were not rerun. All changes remain local; no 
code has been pushed.



-- 
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]

Reply via email to