[Mondrian] Recognizer.checkLevels() issue

Alan Li alanwli at gmail.com
Thu May 17 22:12:29 EDT 2007


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.2release.  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]" column="avg_price"/>
                <AggMeasure name="[Measures].[Volume]"
                <AggLevel name="[Office].[Country]"
                <AggLevel name="[Office].[State]" column="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]" column="source_name"/>
                <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" uniqueMembers="true"/>

        <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/20070517/ffbeee0f/attachment.html 

More information about the Mondrian mailing list