PDA

View Full Version : [Mondrian] Recognizer.checkLevels() issue



Alan Li
05-17-2007, 10:20 PM
Julian,

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]"
column="total_volume"/>
<AggLevel name="[Office].[Country]"
column="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"/>
</AggName>
</Table>
<Dimension name="Office">
<Hierarchy hasAll="true" allMemberName="All Offices"
defaultMember="All Offices">
<Level name="Country" column="office_country"
uniqueMembers="true"/>
<Level name="State" column="office_state"
uniqueMembers="true"/>
<Level name="City" column="office_city"
uniqueMembers="true"/>
<Level name="Name" column="office_name"
uniqueMembers="true"/>
</Hierarchy>
</Dimension>

<Dimension name="Source">
<Hierarchy hasAll="true" allMemberName="All Sources"
defaultMember="All Sources">
<Level name="Type" column="source_type"
uniqueMembers="true"/>
<Level name="Provider" column="source_name"
uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<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"/>
</Hierarchy>
</Dimension>

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

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

_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian

Julian Hyde
05-18-2007, 01:41 PM
Alan,

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.

Thanks,

Julian


_____

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


Julian,

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]"
column="avg_price"/>
<AggMeasure name="[Measures].[Volume]"
column="total_volume"/>
<AggLevel name="[Office].[Country]"
column="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"/>
</AggName>
</Table>
<Dimension name="Office">
<Hierarchy hasAll="true" allMemberName="All Offices"
defaultMember="All Offices">
<Level name="Country" column="office_country"
uniqueMembers="true"/>
<Level name="State" column="office_state"
uniqueMembers="true"/>
<Level name="City" column="office_city"
uniqueMembers="true"/>
<Level name="Name" column="office_name"
uniqueMembers="true"/>
</Hierarchy>
</Dimension>

<Dimension name="Source">
<Hierarchy hasAll="true" allMemberName="All Sources"
defaultMember="All Sources">
<Level name="Type" column="source_type"
uniqueMembers="true"/>
<Level name="Provider" column="source_name"
uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<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"/>
</Hierarchy>
</Dimension>

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

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




_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian