[Mondrian] Segment rollup issue

Matt Campbell mcampbell at pentaho.com
Tue Oct 8 12:10:26 EDT 2013


Thanks Luc.  I've created MONDRIAN-1729 for this.  The test below reliably causes the failure:

 public void testBadRollupCausesGreaterThan12Iterations() {
        getTestContext().flushSchemaCache();
        TestContext context = getTestContext().withFreshConnection();
        context.executeQuery("select "
            + "{[Time].[1997].[Q1].[1], [Time].[1997].[Q3].[8], [Time].[1997].[Q3].[9], "
            + "[Time].[1997].[Q4].[10], [Time].[1997].[Q4].[11], [Time].[1997].[Q4].[12],"
            + "[Time].[1998].[Q1].[1], [Time].[1998].[Q3].[8], [Time].[1998].[Q3].[9], "
            + "[Time].[1998].[Q4].[10], [Time].[1998].[Q4].[11], [Time].[1998].[Q4].[12]}"
            + "on 0 from sales");
        context.executeQuery("select "
            + "{[Time].[1998].[Q1].[2],[Time].[1998].[Q1].[3],"
            + "[Time].[1998].[Q2].[4],[Time].[1998].[Q2].[5],"
            + "[Time].[1998].[Q2].[5],[Time].[1998].[Q2].[6],"
            + "[Time].[1998].[Q3].[7]} on 0 from sales");

        context.executeQuery("select [Time].[1998].[Q1] on 0 from sales");
    }


On 10/08/2013 11:43 AM, Luc Boudreau wrote:
Sounds like it is using the last segment of the ones that need to be rolled up and it can't find the value '1998' explicitly, so it fails.

Your assumption is right. The resulting segment should be constrained on 1998. That's the only possible valid result.

Luc


On Tue, Oct 8, 2013 at 11:23 AM, Matt Campbell <mcampbell at pentaho.com<mailto:mcampbell at pentaho.com>> wrote:

We've had an issue for quite awhile where some small set of tests fail infrequently with the error "Query required more than 12 iterations".  I think I now have a general idea of what's going on, and thought I'd describe what I've seen in case others have insight.

In some tests (e.g. FunctionTest.testLastPeriods()) a cell request is made for [1998].[Q1].  The cache at this point contains the following two segments:
Axes:[
    {time_by_day.the_year=('1998')}
    {time_by_day.quarter=(*)}
    {time_by_day.month_of_year=('2','3','4','5','6','7')}]

Axes:[
    {time_by_day.the_year=(*)}
    {time_by_day.quarter=(*)}
    {time_by_day.month_of_year=('1','8','9','10','11','12')}]

Which get rolled up to
Axes:[
    {time_by_day.the_year=)}
    {time_by_day.quarter=(*)}]

Note that the_year=<blank>, which occurs when the values list is non-null but empty.  Because the_year has an empty values list, the cell request for [1998].[Q1] cannot be answered, and we repeat the cycle, again rolling up the same 2 segments.

I believe the rolled up segment in this case should be constrained by '1998'.  Does that sound right?



_______________________________________________
Mondrian mailing list
Mondrian at pentaho.org<mailto: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/20131008/0a4f43ef/attachment.html 


More information about the Mondrian mailing list