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