[Mondrian] Recognizer.checkLevels() issue

Julian Hyde julianhyde at speakeasy.net
Fri May 18 13:31:27 EDT 2007

That looks like a bug to me. Can you please log it as a bug against
mondrian at sf.net, with the testcase you provided below?
I think that the "unknown usage" message is just a warning, which you
can safely ignore, so this bug has a workaround.


From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org]
On Behalf Of Alan Li
Sent: Thursday, May 17, 2007 7:12 PM
To: mondrian at pentaho.org
Subject: [Mondrian] Recognizer.checkLevels() issue


Suppose a user designs the base fact table that is fully de-normalized
(e.g. members of each level are in the fact table for all dimensions.
And I know that this is normally designed as a start schema where there
are separate dimension tables, but this is a requirement that we have).
And suppose the user creates an aggregate table for that fact table,
then he would see warning messages like: 

mondrian.rolap.aggmatcher.AggTableManager -
Recognizer.checkUnusedColumns: Candidate aggregate table 'agg_1_facts'
for fact table 'facts' has a column 'month' with unknown usage.

I believe that this may be an issue in Recognizer.checkLevels() where
the hierarchyUsage has no foreign key, thus will not match any of the
notSeenForeignKeys.  This ends up preventing the code from trying to
match the levels to the aggtable columns.

The following is my schema file that causes this problem with the 2.3.2
release.  Your feedback is appreciated.

<?xml version="1.0"?>
<Schema name="fx">
    <Cube name="fx" cache="false">
        <Table schema="fx4olap" name="facts"> 
            <AggName schema="fx4olap" name="agg_1_facts">
                <AggFactCount column="row_count"/>
                <AggMeasure name="[Measures].[Price]"
                <AggMeasure name="[Measures].[Volume]"
                <AggLevel name="[Office].[Country]"
                <AggLevel name="[Office].[State]"
                <AggLevel name="[Office].[City]" column="office_city"/>
                <AggLevel name="[Office].[Name]" column="office_name"/>
                <AggLevel name="[Source].[Type]" column="source_type"/> 
                <AggLevel name="[Source].[Provider]"
                <AggLevel name="[Time].[Year]" column="year"/>
                <AggLevel name="[Time].[Month]" column="month"/> 
                <AggLevel name="[Time].[Day]" column="day"/>
                <AggLevel name="[Symbol].[Symbol]" column="symbol"/>
        <Dimension name="Office">
            <Hierarchy hasAll="true" allMemberName="All Offices"
defaultMember="All Offices"> 
                <Level name="Country" column="office_country"
                <Level name="State" column="office_state"
                <Level name="City" column="office_city"
                <Level name="Name" column="office_name"

        <Dimension name="Source"> 
            <Hierarchy hasAll="true" allMemberName="All Sources"
defaultMember="All Sources">
                <Level name="Type" column="source_type"
                <Level name="Provider" column="source_name"
        <Dimension name="Time" type="TimeDimension"> 
            <Hierarchy hasAll="false">
                <Level name="Year" column="year" type="Numeric"
uniqueMembers="true" levelType="TimeYears"/> 
                <Level name="Month" column="month" type="Numeric"
uniqueMembers="false" levelType="TimeMonths"/>
                <Level name="Day" column="day" type="Numeric"
uniqueMembers="false" levelType="TimeDays"/> 

        <Dimension name="Symbol">
            <Hierarchy hasAll="false">
                <Level name="Symbol" column="symbol"

        <Measure name="Price" column="price" aggregator="avg"
formatString="#,###.##" visible="true"/> 
        <Measure name="Volume" column="volume" aggregator="sum"
formatString="#,###,###,###" visible="true"/>

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

More information about the Mondrian mailing list