[Mondrian] non empty cross join missing data

Pedro Alves pmgalves at gmail.com
Mon May 2 12:12:17 EDT 2016


Is there a jira on this?
On May 2, 2016 17:09, "Adam Brusselback" <adambrusselback at gmail.com> wrote:

> Alright, since I got no feedback, I fixed it how I thought best, and have
> tested it for the past week or so. No issues found so far. I submitted it
> back to the fork that Saiku keeps of Mondrian, but I thought i'd link to it
> here so you guys can get it fixed upstream.
>
> Here is the pull request:
>
> https://github.com/OSBI/mondrian/commit/3744676b7a3388d99825f427cb7e3b530ee86cbe
>
> On Tue, Apr 26, 2016 at 2:28 PM, Adam Brusselback <
> adambrusselback at gmail.com> wrote:
>
>> So, sorry. I was a bit tired when I sent this last night. I should add a
>> bit more info so it's possible to look into.
>>
>> Here is the mdx for the first picture:
>>
>> WITH
>> SET [~COLUMNS] AS
>>     {[Time].[Fiscal].[Fiscal Year].Members}
>> SET [~ROWS] AS
>>     {[Direct-Indirect].[Direct-Indirect].[Direct-Indirect].Members}
>> SELECT
>> CrossJoin([~COLUMNS], {[Measures].[Net Sales]}) ON COLUMNS,
>> NON EMPTY [~ROWS] ON ROWS
>> FROM [Pinnacle - Sale]
>>
>>
>> mdx for the second picture:
>>
>> WITH
>> SET [~COLUMNS] AS
>>     {[Time].[Fiscal].[Fiscal Year].Members}
>> SET [~ROWS] AS
>>     {[Direct-Indirect].[Direct-Indirect].[Direct-Indirect].Members}
>> SELECT
>> NON EMPTY CrossJoin([~COLUMNS], {[Measures].[Net Sales]}) ON COLUMNS,
>> NON EMPTY [~ROWS] ON ROWS
>> FROM [Pinnacle - Sale]
>>
>>
>> mdx for the third picture:
>>
>> WITH
>> SET [~COLUMNS] AS
>>     {[Direct-Indirect].[Direct-Indirect].[Direct-Indirect].Members}
>> SET [~ROWS] AS
>>     {[Time].[Fiscal].[Fiscal Year].Members}
>> SELECT
>> NON EMPTY CrossJoin([~COLUMNS], {[Measures].[Net Sales]}) ON COLUMNS,
>> NON EMPTY [~ROWS] ON ROWS
>> FROM [Pinnacle - Sale]
>>
>>
>>
>> I have been trying to debug this myself all today, and made a little
>> progress...
>>
>> My issue lies in the RolapMemberBase equals overrride.
>>
>> It doesn't take into account different keys for the same member.  So I
>> have a  [Time].[Fiscal].[2015] with a key of (1, 2015), and when it goes
>> through the RolapEvaluator.same method (called in setContext) it sees them
>> as the same thing and doesn't do a replace in the currentMember list when
>> my next member with a key of (2, 2015) comes in.
>>
>> So I am not sure where the fix really needs to go for this, if it's in
>> the RolapMemberBase.equals method (don't know how far reaching that could
>> be), or in the RolapEvaluator.same method.  I could use some direction on
>> this, as I do need it fixed for my own use, but would much rather do it in
>> a way that could be submitted back to the project.
>>
>> On Tue, Apr 26, 2016 at 3:33 AM, Adam Brusselback <
>> adambrusselback at gmail.com> wrote:
>>
>>> Hey all, I seem to have found a bug in the non empty cross join
>>> optimization.
>>> Mondrian version: 4.3.0.1
>>>
>>> I have a data warehouse that is multi-tenant, and has a date dimension
>>> with different fiscal information per client (all tables segregated by a
>>> client_sk).  Each client has their own fiscal calendar, so it's necessary
>>> to separate them out like that.
>>>
>>> The issue seems to be, when  doing the cross join non empty with my
>>> fiscal year as a column, if the first result that comes back for that
>>> member is empty, even though it is for a totally different client, it will
>>> throw out that whole member.
>>>
>>> If the fiscal year is in the row, and another member in the column, the
>>> query returns as expected.
>>>
>>> I'll attach a few example query images:
>>> Example of why it seems to be removing the members (not first in the
>>> list):
>>> [image: Inline image 5]
>>>
>>> Here is my problem query:
>>> [image: Inline image 2]
>>>
>>> Here it is with the column/row flipped:
>>> [image: Inline image 4]
>>>
>>
>>
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20160502/9735af48/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 41303 bytes
Desc: not available
Url : http://lists.pentaho.org/pipermail/mondrian/attachments/20160502/9735af48/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 28416 bytes
Desc: not available
Url : http://lists.pentaho.org/pipermail/mondrian/attachments/20160502/9735af48/attachment-0004.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 23056 bytes
Desc: not available
Url : http://lists.pentaho.org/pipermail/mondrian/attachments/20160502/9735af48/attachment-0005.png 


More information about the Mondrian mailing list