Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-31536

STDDEV, STDDEV_SAMP, STDDEV_POP functions definition error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.5.0
    • 6.5.0
    • query
    • Untriaged
    • Centos 64-bit
    • No

    Description

      Let's take a look at the relations between listed functions from different approaches:

      MySQL:

      STDDEV() = STDDEV_POP()

      STDDEV() != STDDEV_SAMP()

      Couchbase:

      STDDEV() = STDDEV_SAMP() — There is difference in case of one row ( It differs from STDDEV_SAMP in that STDDEV returns zero when it has only 1 row of input data, whereas STDDEV_SAMP returns null.)

      STDDEV() != STDDEV_POP()

      Spec:

      https://docs.google.com/document/d/1y4MDYI0R5nykSFJGOA4v0OSbg35YfPbaFUAvVq6vcRA/edit#heading=h.wpmh045jt8nd

      STDDEV() = STDDEV_SAMP()

      STDDEV() != STDDEV_POP()

      Real life:

      STDDEV() = STDDEV_POP()

      STDDEV() != STDDEV_SAMP()

       

      So, I think, STDDEV_POP() and STDDEV_SAMP() are messed in specification and in Couchbase backend. 

      Same thing for VARIANCE(), VARIANCE_POP(), VARIANCE_SAMP() functions

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            evgeny.makarenko Evgeny Makarenko (Inactive)
            evgeny.makarenko Evgeny Makarenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty