Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15541

Investigate changes in SERVER-67282: $add expression should not use DoubleDoubleSummation in SBE

    XMLWordPrintableJSON

Details

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 25 weeks, 5 days ago