-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Minor Change
-
v6.0
-
QE 2022-07-11, QE 2022-07-25, QE 2022-08-08, QE 2022-08-22
-
164
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-19735and 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.
- causes
-
SERVER-68679 Throw error on overflow for $add with NumberDecimal + Date in the classic aggregation engine
- Closed
- is duplicated by
-
SERVER-62485 Match the SBE $add behavior to the classic engine's or the other way around
- Closed
- is related to
-
SERVER-65465 SBE Group should not use DoubleDoubleSummation for count
- Closed
- related to
-
SERVER-65735 $add operator should not use DoubleDoubleSummation in the classic engine
- Closed
-
SERVER-68543 Make $add operator type left associate for date in classic engine
- Closed
-
SERVER-68544 Make overflow decimal throws exception in classic engine
- Closed
-
SERVER-68810 Complete TODO listed in SERVER-67282
- Closed