[Mondrian] Eigenbase perforce change 14675 for review

Julian Hyde jhyde at pentaho.com
Fri Oct 7 00:23:32 EDT 2011


On Oct 6, 2011, at 6:17 PM, Luc Boudreau wrote:

> The problem appears when doing a count(distinct x) operation. All platforms return the null as a distinct value while Greenplum ignores it. I'll double check everything and revert if necessary. Thanks for the warning.
> 
count(distinct x) should eliminate the duplicates but still not count the null values. Thus, if the table has values {null, 1, 2, 2, 2} it should return 2. If it just has value {null} is should return 0.

(I've implemented the rewrite rule
  select count(distinct x) from t
    --> select count(dx) from (select distinct x as dx from t)
more than once in my RDBMS-implementing career.)

I just checked, and MySQL does this. I'm 99.9% certain Oracle does too.

So... Greenplum is standards-compliant here.

If there's a specific query where Greenplum is giving a dubious result, send me the SQL and I'll check it out.

Julian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20111006/deb93105/attachment.html 


More information about the Mondrian mailing list