Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-67282

$add expression should not use DoubleDoubleSummation in SBE

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      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-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:
            zixuan.zhuang@mongodb.com Zixuan Zhuang
            Reporter:
            davis.haupt@mongodb.com Davis Haupt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: