You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/09 12:19:41 UTC

[GitHub] [spark] maropu commented on pull request #29983: [SPARK-13860][SQL] Change stddev_samp and var_samp to return 0.0 instead of Double.NaN to align with TPCDS standard.

maropu commented on pull request #29983:
URL: https://github.com/apache/spark/pull/29983#issuecomment-706148055


   Really, we need to return 0.0 in the case? Looks PostgreSQL/MySQL returns null instead;
   ```
   mysql> create table t (v float8);
   mysql> insert into t values (1.0);
   mysql> SELECT stddev_samp(v) FROM t;
   +----------------+
   | stddev_samp(v) |
   +----------------+
   |           NULL |
   +----------------+
   1 row in set (0.00 sec)
   
   
   postgres=# create table t (v float8);
   postgres=# insert into t values (1.0);
   INSERT 0 1
   postgres=# \pset null 'null'
   Null display is "null".
   postgres=# SELECT stddev_samp(v) FROM t;
    stddev_samp 
   -------------
           null
   (1 row)
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org