[Mondrian] mapping table (between two many-to-many related table) in schema xml file for a Cube

Radha Ranjan Madhaw RMadhaw at facetime.com
Mon May 19 05:05:59 EDT 2008


Hi,

I've the following start schema:

tables: users [userid, username] (dimension table), 
           groups [groupid, groupname] (not a dimension table),
           user_group [id, userid, groupid] (not a dimension table), - A
mapping table between users and groups
           timeDimension [id, year, month_of_year, day_of_month]
(dimension table)
           fact_url_hits [id, userid, timeid, hits], (fact table)

The MDX query is: 

SELECT {[Measures].[URL Hits]} ON COLUMNS, NON EMPTY
{[Time].[2008].Children} ON ROWS FROM [MondrianTest] WHERE
[DimUsers].[Group Name].[group5]

Here group5 is a value from groupname column in groups table.

I'm trying to define the DimUser dimension as following:

<Dimension name="DimUsers" foreignKey="userid">
    <Hierarchy hasAll="true" primaryKey="userid"
primaryKeyTable="users">
        <Join leftKey="userid" leftAlias="user_group1"
rightAlias="Users" rightKey="userid">
            <Join leftKey="groupid" leftAlias="user_group"
rightAlias="groups" rightKey="groupid">
                <Table name="user_group"/>
                <Table name="groups"/>
            </Join>
            <Table name="users"/>
        </Join>
        <Level name="User Name" table="users" column="username"
type="String" uniqueMembers="false"/>
        <Level name="Group Name" table="groups" column="groupname"
type="String" uniqueMembers="false"/>
    </Hierarchy>
</Dimension>

I'm getting following exception:

Exception in thread "Thread-0" java.lang.UnsupportedOperationException
    at
mondrian.rolap.RolapCubeHierarchy.extractNewAliases(RolapCubeHierarchy.j
ava:179)
    at
mondrian.rolap.RolapCubeHierarchy.extractNewAliases(RolapCubeHierarchy.j
ava:176)
    at
mondrian.rolap.RolapCubeHierarchy.<init>(RolapCubeHierarchy.java:88)
    at
mondrian.rolap.RolapCubeDimension.<init>(RolapCubeDimension.java:48)
    at mondrian.rolap.RolapCube.getOrCreateDimension(RolapCube.java:658)
    at mondrian.rolap.RolapCube.<init>(RolapCube.java:145)
    at mondrian.rolap.RolapCube.<init>(RolapCube.java:175)
    at mondrian.rolap.RolapSchema.load(RolapSchema.java:438)
    at mondrian.rolap.RolapSchema.load(RolapSchema.java:335)
    at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:226)
    at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:79)
    at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:923)
    at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:732)
    at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:152)
    at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:83)


First thing which I want to know is whether I can incorporate a mapping
table (user_group in this case) in mondrian schema or not. If so, what
is the problem in my DimUser definition?

Thanks,
-Madhav

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


More information about the Mondrian mailing list