Pentaho Analysis - Mondrian
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-266

Closure tables do not work in a Snowflake Dimension

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Severe Severe
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      In a situation where I have to mix a snowflake dimension with a Closure table, I get the following error:

      "Internal error: join does not have alias".

      I can see from stepping through the code that this is generated in the file mondrian.rolap.RolapStar$Table.addJoin()

      String rightAlias = join.rightAlias;
        if (rightAlias == null) {
          rightAlias = join.right.getAlias();
          if (rightAlias == null) {
            throw Util.newError(
             "missing rightKeyAlias in " + relation);
          }
       }

      The right hand side of the join for the Closure dimension is also a Join because of the Snowflake. The Join class embedded in Mondrian.xml returns the error when we try to get it's alias:

      public String getAlias() {
        throw Util.newInternal("join does not have alias");
      }

      Here is the relevant section of my schema:

      <Dimension name="User">
      <Hierarchy hasAll="true" primaryKey="user_id" allMemberName="All" primaryKeyTable="dim_users">
      <Join leftKey="dim_user_fused_groups_fused_group_id" rightAlias="dim_user_fused_groups" rightKey="fused_group_id">
      <Table name="dim_users"/>
      <Table name="dim_user_fused_groups"/>
      </Join>
      <Level name="User Groups" table="dim_user_fused_groups" column="fused_group_names" uniqueMembers="true"/>
      <Level name="User Id" table="dim_users" column="user_id" type="Numeric" parentColumn="manager_id" nameColumn="Name" nullParentValue="0" uniqueMembers="true">
      <Closure parentColumn="dim_users_manager_id" childColumn="dim_users_user_id">
      <Table name="dim_user_manager_closure"/>
      </Closure>
      <Property name="Name" column="name"/>
      <Property name="Description" column="description"/>
      <Property name="Login" column="login"/>
      <Property name="Email" column="email"/>
      </Level>
      </Hierarchy>
      </Dimension>

      Here is the full stack trace:

      2007-03-05 12:41:34,127 ERROR [http-8080-Processor25] com.tonbeller.jpivot.tags.OlapModelTag (OlapModelTag.java:80) -
      mondrian.olap.MondrianException: Mondrian Error:Internal error: join does not have alias
      at mondrian.resource.MondrianResource$_Def0.ex(Mondri anResource.java:852)
      at mondrian.olap.Util.newInternal(Util.java:947)
      at mondrian.olap.MondrianDef$Join.getAlias(MondrianDe f.java:2125)
      at mondrian.rolap.RolapStar$Table.addJoin(RolapStar.j ava:1266)
      at mondrian.rolap.RolapCube.registerDimension(RolapCu be.java:1336)
      at mondrian.rolap.RolapLevel.init(RolapLevel.java:377 )
      at mondrian.rolap.RolapHierarchy.init(RolapHierarchy. java:275)
      at mondrian.rolap.RolapDimension.init(RolapDimension. java:193)
      at mondrian.rolap.RolapCube.init(RolapCube.java:865)
      at mondrian.rolap.RolapCube.<init>(RolapCube.java:244 )
      at mondrian.rolap.RolapSchema.load(RolapSchema.java:3 90)
      at mondrian.rolap.RolapSchema.load(RolapSchema.java:2 72)
      at mondrian.rolap.RolapSchema.<init>(RolapSchema.java :212)
      at mondrian.rolap.RolapSchema.<init>(RolapSchema.java :89)
      at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.ja va:828)
      at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.ja va:653)
      at mondrian.rolap.RolapConnection.<init>(RolapConnect ion.java:141)
      at mondrian.rolap.RolapConnection.<init>(RolapConnect ion.java:76)
      at mondrian.olap.DriverManager.getConnection(DriverMa nager.java:120)
      at mondrian.olap.DriverManager.getConnection(DriverMa nager.java:87)
      at com.tonbeller.jpivot.mondrian.MondrianModel.initia lize(MondrianModel.java:400)
      at com.tonbeller.jpivot.olap.model.OlapModelDecorator .initialize(OlapModelDecorator.java:129)
      at com.tonbeller.jpivot.tags.OlapModelProxy$MyState.i nitialize(OlapModelProxy.java:76)
      at com.tonbeller.jpivot.tags.PageStateManager.initial izeAndShow(PageStateManager.java:37)
      at com.tonbeller.jpivot.tags.OlapModelProxy.initializ eAndShow(OlapModelProxy.java:161)
      at com.tonbeller.jpivot.tags.OlapModelTag.doEndTag(Ol apModelTag.java:76)
      at org.apache.jsp.WEB_002dINF.queries.activity_jsp._j spx_meth_jp_mondrianQuery_0(activity_jsp.java:126)
      at org.apache.jsp.WEB_002dINF.queries.activity_jsp._j spService(activity_jsp.java:64)
      at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
      at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:334)
      at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:672)
      at org.apache.catalina.core.ApplicationDispatcher.doI nclude(ApplicationDispatcher.java:574)
      at org.apache.catalina.core.ApplicationDispatcher.inc lude(ApplicationDispatcher.java:499)
      at com.tonbeller.wcf.utils.IncludeTag.doStartTag(Incl udeTag.java:59)
      at org.apache.jsp.testpage_jsp._jspx_meth_wcf_include _0(testpage_jsp.java:277)
      at org.apache.jsp.testpage_jsp._jspService(testpage_j sp.java:122)
      at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
      at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:334)
      at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at com.tonbeller.wcf.controller.RequestFilter$MyHandl er.normalRequest(RequestFilter.java:139)
      at com.tonbeller.wcf.controller.RequestSynchronizer.h andleRequest(RequestSynchronizer.java:127)
      at com.tonbeller.wcf.controller.RequestFilter.doFilte r(RequestFilter.java:263)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      2007-03-05 12:41:34,174 ERROR [http-8080-Processor25] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/connect-repo
      rts].[jsp] (ApplicationDispatcher.java:704) - Servlet.service() for servlet jsp threw exception
      mondrian.olap.MondrianException: Mondrian Error:Internal error: join does not have alias
      at mondrian.resource.MondrianResource$_Def0.ex(Mondri anResource.java:852)
      at mondrian.olap.Util.newInternal(Util.java:947)
      at mondrian.olap.MondrianDef$Join.getAlias(MondrianDe f.java:2125)
      at mondrian.rolap.RolapStar$Table.addJoin(RolapStar.j ava:1266)
      at mondrian.rolap.RolapCube.registerDimension(RolapCu be.java:1336)
      at mondrian.rolap.RolapLevel.init(RolapLevel.java:377 )
      at mondrian.rolap.RolapHierarchy.init(RolapHierarchy. java:275)
      at mondrian.rolap.RolapDimension.init(RolapDimension. java:193)
      at mondrian.rolap.RolapCube.init(RolapCube.java:865)
      at mondrian.rolap.RolapCube.<init>(RolapCube.java:244 )
      at mondrian.rolap.RolapSchema.load(RolapSchema.java:3 90)
      at mondrian.rolap.RolapSchema.load(RolapSchema.java:2 72)
      at mondrian.rolap.RolapSchema.<init>(RolapSchema.java :212)
      at mondrian.rolap.RolapSchema.<init>(RolapSchema.java :89)
      at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.ja va:828)
      at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.ja va:653)
      at mondrian.rolap.RolapConnection.<init>(RolapConnect ion.java:141)
      at mondrian.rolap.RolapConnection.<init>(RolapConnect ion.java:76)
      at mondrian.olap.DriverManager.getConnection(DriverMa nager.java:120)
      at mondrian.olap.DriverManager.getConnection(DriverMa nager.java:87)
      at com.tonbeller.jpivot.mondrian.MondrianModel.initia lize(MondrianModel.java:400)
      at com.tonbeller.jpivot.olap.model.OlapModelDecorator .initialize(OlapModelDecorator.java:129)
      at com.tonbeller.jpivot.tags.OlapModelProxy$MyState.i nitialize(OlapModelProxy.java:76)
      at com.tonbeller.jpivot.tags.PageStateManager.initial izeAndShow(PageStateManager.java:37)
      at com.tonbeller.jpivot.tags.OlapModelProxy.initializ eAndShow(OlapModelProxy.java:161)
      at com.tonbeller.jpivot.tags.OlapModelTag.doEndTag(Ol apModelTag.java:76)
      at org.apache.jsp.WEB_002dINF.queries.activity_jsp._j spx_meth_jp_mondrianQuery_0(activity_jsp.java:126)
      at org.apache.jsp.WEB_002dINF.queries.activity_jsp._j spService(activity_jsp.java:64)
      at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
      at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:334)
      at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:672)
      at org.apache.catalina.core.ApplicationDispatcher.doI nclude(ApplicationDispatcher.java:574)
      at org.apache.catalina.core.ApplicationDispatcher.inc lude(ApplicationDispatcher.java:499)
      at com.tonbeller.wcf.utils.IncludeTag.doStartTag(Incl udeTag.java:59)
      at org.apache.jsp.testpage_jsp._jspx_meth_wcf_include _0(testpage_jsp.java:277)
      at org.apache.jsp.testpage_jsp._jspService(testpage_j sp.java:122)
      at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
      at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:334)
      at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at com.tonbeller.wcf.controller.RequestFilter$MyHandl er.normalRequest(RequestFilter.java:139)
      at com.tonbeller.wcf.controller.RequestSynchronizer.h andleRequest(RequestSynchronizer.java:127)
      at com.tonbeller.wcf.controller.RequestFilter.doFilte r(RequestFilter.java:263)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)

        Activity

        Hide
        Mondrian Importer User added a comment -
        {bcassidy123}, 03/06/2007: IP, Artifact Created: 216.104.211.5 |
        {willgorman}, 04/06/2007: IP, Comment Added: 72.77.212.69 |
        {willgorman}, 04/10/2007: IP, Comment Added: 72.77.253.87 |
        {willgorman}, 04/10/2007: status_id, 1 |
        {willgorman}, 04/10/2007: resolution_id, 100 |
        {willgorman}, 04/10/2007: close_date, 0
        Show
        Mondrian Importer User added a comment - {bcassidy123}, 03/06/2007: IP, Artifact Created: 216.104.211.5 | {willgorman}, 04/06/2007: IP, Comment Added: 72.77.212.69 | {willgorman}, 04/10/2007: IP, Comment Added: 72.77.253.87 | {willgorman}, 04/10/2007: status_id, 1 | {willgorman}, 04/10/2007: resolution_id, 100 | {willgorman}, 04/10/2007: close_date, 0
        Hide
        Mondrian Importer User added a comment -
        {willgorman}, 04/06/2007: Logged In: YES
        user_id=160824
        Originator: NO

        I've added a test case that reproduces this bug:
        ParentChildHierarchyTest._testSnowflakeClosure()
        Show
        Mondrian Importer User added a comment - {willgorman}, 04/06/2007: Logged In: YES user_id=160824 Originator: NO I've added a test case that reproduces this bug: ParentChildHierarchyTest._testSnowflakeClosure()
        Hide
        Mondrian Importer User added a comment -
        {willgorman}, 04/10/2007: Logged In: YES
        user_id=160824
        Originator: NO

        Committed fix and test case in change #9079. I added functionality to RolapStar.Table.addJoin() for support of multiple levels of Joins.
        Show
        Mondrian Importer User added a comment - {willgorman}, 04/10/2007: Logged In: YES user_id=160824 Originator: NO Committed fix and test case in change #9079. I added functionality to RolapStar.Table.addJoin() for support of multiple levels of Joins.

          People

          • Assignee:
            Unassigned User
            Reporter:
            bcassidy123
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: