[SERVER-67282] $add expression should not use DoubleDoubleSummation in SBE Created: 14/Jun/22  Updated: 29/Oct/23  Resolved: 13/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Davis Haupt (Inactive) Assignee: Zixuan Zhuang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-15541 Investigate changes in SERVER-67282: ... Closed
Duplicate
is duplicated by SERVER-62485 Match the SBE $add behavior to the cl... Closed
Problem/Incident
causes SERVER-68679 Throw error on overflow for $add with... Closed
Related
related to SERVER-65735 $add operator should not use DoubleDo... Closed
related to SERVER-68543 Make $add operator type left associat... Closed
related to SERVER-68544 Make overflow decimal throws exceptio... Closed
related to SERVER-68810 Complete TODO listed in SERVER-67282 Closed
is related to SERVER-65465 SBE Group should not use DoubleDouble... Closed
Backwards Compatibility: Minor Change
Sprint: QE 2022-07-11, QE 2022-07-25, QE 2022-08-08, QE 2022-08-22
Participants:
Linked BF Score: 164

 Description   

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 Githook User [ 11/Aug/22 ]

Author:

{'name': 'Zixuan', 'email': 'leozzx@users.noreply.github.com', 'username': 'leozzx'}

Message: SERVER-67282 $add not to use DoubleDoubleSum in SBE
Branch: master
https://github.com/mongodb/mongo/commit/0ee2ddd2ba1a0a509ac25eb787563be27572013c

Comment by Githook User [ 09/Aug/22 ]

Author:

{'name': 'Sviatlana Zuiko', 'email': 'sviatlana.zuiko@mongodb.com', 'username': 'szuiko'}

Message: Revert "SERVER-67282 $add not to use DoubleDoubleSum in SBE"

This reverts commit 1284566dfda0a21a6da9451742967a8f67f586d6.
Branch: master
https://github.com/mongodb/mongo/commit/0dae5d681ec2a28881c3e87463d4248606ec264d

Comment by Githook User [ 08/Aug/22 ]

Author:

{'name': 'Zixuan Zhuang', 'email': 'zixuan.zhuang@mongodb.com', 'username': 'leozzx'}

Message: SERVER-67282 $add not to use DoubleDoubleSum in SBE
Branch: master
https://github.com/mongodb/mongo/commit/1284566dfda0a21a6da9451742967a8f67f586d6

Generated at Thu Feb 08 06:07:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.