[Mondrian] xmla servlet - bug in RowsetDefinition

Julian Hyde jhyde at pentaho.com
Tue May 24 18:32:28 EDT 2011

The first dimension is always "Measures". (Note that when you define a cube,
you don't define a Measures dimension -- Mondrian creates it for you.)


From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On
Behalf Of Michele Rossi
Sent: Tuesday, May 24, 2011 6:22 AM
To: Mondrian developer mailing list
Subject: [Mondrian] xmla servlet - bug in RowsetDefinition

I've discovered another part of RowsetDefinition which can only work
reliably using the mondrian olap4j driver.

The line number is 5096 and the code snippet in question is the following:

protected void populateCatalog(
            OlapConnection connection,
            Catalog catalog,
            List<Row> rows)
            throws XmlaException, SQLException
            // SQL Server actually includes the LEVELS_LIST row
            StringBuilder buf = new StringBuilder(100);

            for (Schema schema : filter(catalog.getSchemas(),
schemaNameCond)) {
                for (Cube cube : filter(sortedCubes(schema), cubeNameCond))
                    Dimension measuresDimension =
                    Hierarchy measuresHierarchy =

As you can see there is a strong assumption made here: that the first
dimension in the list contains the Measures.
The right way to do this is to iterate through the array and stop when
"dimension type" is MEASURE.


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

More information about the Mondrian mailing list