[Mondrian] Fact Count problem. and WHERE/GROUP BY AggGen concern

Ati Rosselet ati.rosselet at gmail.com
Sun Jul 18 09:25:17 EDT 2010


I have run into a problem with the default generated "Fact Count" measure
(if no COUNT measure is in the cube schema).
The problem is that the xmlMeasure has no column, and according to the code,
that's fine (even a comment there), AggGen.java
but the problem is that AggGen then dies horribly since we end up with a
measure of "count(null)" and there is no "null" column.
(count(*) would be nicer... :))
If I add in a hidded Fact Count measure, this problem goes away.

I also seem to be having strange AggGen tables generated, missing WITH and
GROUPBY sections... something like:

2010-07-18 14:33:43,848 INFO  [STDOUT] insertIntoCollapsed:
INSERT INTO agg_c_XXX_invoice_and_item (
    amount,
    itemid,
    fact_count)
SELECT
    sum("invoice_and_item"."amount") AS "amount",
    count("invoice_and_item"."itemid") AS "itemid",
    COUNT(*) AS "fact_count"
FROM
    "invoice_and_item" "invoice_and_item",

WHERE

GROUP BY
;

as far as I can see, the code ALWAYS generated the WHERE and GROUP BY code,
even if there is nothing to generate.  I would think that that whole section
should be wrapped in an if statement:

if (!collapsedColumnUsages.isEmpty())
{
        pw.println();
        pw.println("WHERE ");
....
        pw.println();
        pw.println("GROUP BY ");
....
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20100718/bbf5a0f2/attachment.html 


More information about the Mondrian mailing list