Fix spilling with $stdDevPop/Samp with large numbers

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL
    • 0
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Here in accumulator_std_dev.cpp when we're merging spilled results, we find the delta from the previous mean and use it to calculate the std dev per the variance algorithm mentioned in the same file which involves squaring delta. The mean is started as 0 so when the first datapoint is very large squaring delta can lead to delta*delta = nan. 

      I've attached a repro (the pipeline is little weird because I just simplified a fuzzer query).repro_spill.js

      As a part of this ticket we might also want to think about what behavior 

        1. repro_spill.js
          2 kB
          Kristina Znam

              Assignee:
              Unassigned
              Reporter:
              Kristina Znam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: