[Mondrian] Hierarchy must have a foreign key error

Matt Campbell mcampbell at pentaho.com
Fri May 16 08:39:39 EDT 2014

The rule is that a hierarchy must either specify a foreign key, or use the same table as the fact table (i.e. it must be degenerate).  Is your schema violating that rule?

It is curous that you're seeing that error with newer versions of Mondrian but not pre-3.6.6, the logic around that check hasn't changed in quite awhile.  Can you post a snippet of your schema?

From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On Behalf Of Hilario Fernandes
Sent: Friday, May 16, 2014 7:57 AM
To: Mondrian mailing list
Subject: [Mondrian] Hierarchy must have a foreign key error


Since mondrian 3.6.6 build and above i'm getting a strange error in my project:

mondrian.olap.MondrianException: Mondrian Error:Hierarchy 'hier_name' in cube 'cube_name' must have a foreign key, since it is not based on the cube's fact table.
            at mondrian.resource.MondrianResource$_Def1.ex(MondrianResource.java:989)
            at mondrian.rolap.RolapCube.registerDimension(RolapCube.java:1770)
            at mondrian.rolap.RolapCube.<init>(RolapCube.java:203)
            at mondrian.rolap.RolapCube.<init>(RolapCube.java:227)
            at mondrian.rolap.RolapSchema.createCube(RolapSchema.java:917)

It seems like it's related to degenerate dimensions and the usage of alias in the fact table. In version 3.6.5 and bellow this error only occurred when the alias was specified, but now there seem to have been some changes on the class RolapSchema that enforces the usage of the alias.

In my project i'm adding and removing cubes from the schema, and this seems to mask the problem, since it only occurs after some time so i'm unable to blame any specific query or cube.

Anyone has ideas on this, or is getting the same error?

Thank you

Hilario Fernandes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20140516/90406e52/attachment.html 

More information about the Mondrian mailing list