[DOCS-15541] Investigate changes in SERVER-67282: $add expression should not use DoubleDoubleSummation in SBE Created: 13/Aug/22  Updated: 13/Nov/23  Resolved: 08/Dec/22

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 6.1.0-rc0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-67282 $add expression should not use Double... Closed
Duplicate
duplicates DOCS-15420 [SERVER] Investigate changes in SERVE... Closed
Participants:
Days since reply: 1 year, 25 weeks, 5 days ago
Epic Link: DOCSP-21764

 Description   
Original Downstream Change Summary

Two behavior in sbe won't match classic engine (classic engine pending SERVER-68544, SERVER-68543):
Date + overflowDecimal/nanDecimal behavior change: nanDate -> overflow exception
[1.5, date, 1.5] result change: date + 3 -> date + 4 due to rounding

https://docs.google.com/document/d/1J4lkN3eRJSB6mM01NtZ9QQam7ilA_d5CAdb_YBgeGkU/edit?usp=sharing

Description of Linked Ticket

Right now, the SBE stage builder will transform a $add expression in the query language to a DoubleDoubleSum operation. Using DoubleDoubleSum for $add leads to confusing semantics, as explained in the description for SERVER-65735:

Discussed with Geert Bosch who implemented DoubleDoubleSummation in SERVER-19735 and we determined that DoubleDoubleSummation was implemented for use in $group aggregation operators like $sum where the user does not have control over the ordering of input arguments and there are consistently a very large number of values that need to be summed.

For the $add expression, where arguments are passed in explicitly by the end user, we should be prioritizing the behavior which is most clear and obvious and add doubles together normally.

To remain in sync with the classic engine, the stage builder should instead construct a tree of sbe::EPrimBinary::add operations from the variadic operand list.



 Comments   
Comment by Education Bot [ 13/Aug/22 ]

Fix Version updated for upstream SERVER-67282:
6.1.0-rc0

Generated at Thu Feb 08 08:13:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.