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

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

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: manual, Server
    • Labels:
      None

      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.

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

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