[Mondrian] distinct-count and explicit aggregate table recognition

Tomasz Karlik tkarlik at gmail.com
Mon Jan 7 03:47:24 EST 2013


SQL seems to be wrong:

select
    "agg_c_10_sales_fact_1997"."the_year" as "c0",
    sum("agg_c_10_sales_fact_1997"."customer_count") as "m0"
from
    "agg_c_10_sales_fact_1997" as "agg_c_10_sales_fact_1997"
where
    "agg_c_10_sales_fact_1997"."the_year" = 1997
group by
    "agg_c_10_sales_fact_1997"."the_year"

Log file is in attachment.

On Mon, Jan 7, 2013 at 9:19 AM, Julian Hyde <jhyde at pentaho.com> wrote:
> The easiest way to approach this is to look at the SQL Mondrian is generating. Is it asking the right question of the DBMS?
>
> Can you turn on SQL tracing and post the log you get during the run that produces the incorrect results.
>
> Julian
>
>
> On Jan 7, 2013, at 12:10 AM, Tomasz Karlik <tkarlik at gmail.com> wrote:
>
>> I am getting different results while running simple query on FoodMart
>> (PostgreSql db). Result differs and seems to be wrong when using
>> explicit aggregate. I've created simple test which shows this
>> behavior. Also I've made some patch, but i'm not sure if the problem
>> is in sources? The problem doesn't appear when aggregate table is
>> recognized by the default rules.
>>
>> query:
>>
>> select
>>
>> NON EMPTY {[Measures].[Customer Count]} ON COLUMNS,
>>
>> NON EMPTY {[Time].[Year].Members} ON ROWS
>>
>> from [Sales]
>>
>> aggregate table: agg_c_10_sales_fact_1997
>>
>>
>> expected result:
>>
>> Axis #0:
>>
>> {}
>>
>> Axis #1:
>>
>> {[Measures].[Customer Count]}
>>
>> Axis #2:
>>
>> {[Time].[1997]}
>>
>> Row #0: 5 581
>>
>>
>> actual result:
>>
>> Axis #0:
>>
>> {}
>>
>> Axis #1:
>>
>> {[Measures].[Customer Count]}
>>
>> Axis #2:
>>
>> {[Time].[1997]}
>>
>> Row #0: 16 947
>> <ExplicitRecognizerTest.java><mondrian_rolap_aggmatcher_Recognizer.java.patch>_______________________________________________
>> Mondrian mailing list
>> Mondrian at pentaho.org
>> http://lists.pentaho.org/mailman/listinfo/mondrian
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: recognizer_test_log
Type: application/octet-stream
Size: 52551 bytes
Desc: not available
Url : http://lists.pentaho.org/pipermail/mondrian/attachments/20130107/69b2115d/attachment-0001.obj 


More information about the Mondrian mailing list