mirror of
https://github.com/apache/impala.git
synced 2026-01-04 00:00:56 -05:00
In calculating the STDDEV_SAMP/VARIANCE of N rows a divion by N-1 rows is involved. Hence STDDEV_SAMP/VARIANCE for a single row involves a division by 0. This change returns a NULL instead of a 0 when calculating STDDEV_SAMP/VARIANCE for a single row. STDDEV_POP/VARIANCE_POP for single row will still return a 0 since this does not involve a division by 0. This matches the postgres behavior. Change-Id: Ide8af752cd8a2e554a2cd5a1ec948967a80de1fe Reviewed-on: http://gerrit.cloudera.org:8080/5800 Reviewed-by: Matthew Jacobs <mj@cloudera.com> Tested-by: Impala Public Jenkins