You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/08/24 07:00:38 UTC

[GitHub] [incubator-doris] wutiangan opened a new issue #1696: multi sum distianct need return null, not zero

wutiangan opened a new issue #1696: multi sum distianct need return null, not zero
URL: https://github.com/apache/incubator-doris/issues/1696
 
 
   mysql> select sum(distinct id), sum(distinct int_col) from alltypesagg;        
   +--------------------+-------------------------+
   | sum(DISTINCT `id`) | sum(DISTINCT `int_col`) |
   +--------------------+-------------------------+
   |                  0 |                       0 |
   +--------------------+-------------------------+
   1 row in set (0.01 sec)
   
   mysql> select sum(distinct id)  from alltypesagg;                       
   +--------------------+
   | sum(DISTINCT `id`) |
   +--------------------+
   |               NULL |
   +--------------------+
   1 row in set (0.01 sec)
   
   当表中没有数据时,sum distinct应该返回NULL, 而不是0,因为0对sum聚合函数来说是有意义的数。单个sum distinct计算结果没有问题,但是多个sum distinct的计算结果有问题。

----------------------------------------------------------------
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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org