Uploaded image for project: 'Pentaho Analysis - Mondrian'
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-661

Name expressions in snowflake hierarchies do not work, unfriendly exception occurs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: High
    • Resolution: Won't Fix
    • Affects Version/s: 3.5.0 Suite Release
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      Here is the exception:

      mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while executing query [select

      {[Product with inline].[All Product with inlines].[Drink].[Dairy].[Dairy].[Milk].[Club].Children} ON COLUMNS
      from [Sales]
      ]
      at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:816)
      at mondrian.olap.Util.newInternal(Util.java:1492)
      at mondrian.olap.Util.newError(Util.java:1508)
      at mondrian.rolap.RolapConnection.execute(RolapConnection.java:594)
      at mondrian.test.TestContext.executeQuery(TestContext.java:491)
      at mondrian.test.TestContext.assertQueryReturns(TestContext.java:1018)
      at mondrian.test.BasicQueryTest.testSnowFlakeNameExpressions(BasicQueryTest.java:6920)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at junit.framework.TestCase.runTest(TestCase.java:164)
      at junit.framework.TestCase.runBare(TestCase.java:130)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:120)
      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: mondrian.olap.MondrianException: Mondrian Error:Internal error: bad relation type null
      at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:813)
      at mondrian.olap.Util.newInternal(Util.java:1485)
      at mondrian.rolap.sql.SqlQuery.addFrom(SqlQuery.java:363)
      at mondrian.rolap.RolapHierarchy.addToFrom(RolapHierarchy.java:510)
      at mondrian.rolap.SqlMemberSource.makeChildMemberSql(SqlMemberSource.java:603)
      at mondrian.rolap.SqlMemberSource.getMemberChildren2(SqlMemberSource.java:893)
      at mondrian.rolap.SqlMemberSource.getMemberChildren(SqlMemberSource.java:827)
      at mondrian.rolap.SqlMemberSource.getMemberChildren(SqlMemberSource.java:801)
      at mondrian.rolap.SmartMemberReader.readMemberChildren(SmartMemberReader.java:247)
      at mondrian.rolap.SmartMemberReader.getMemberChildren(SmartMemberReader.java:210)
      at mondrian.rolap.RolapCubeHierarchy$CacheRolapCubeHierarchyMemberReader.readMemberChildren(RolapCubeHierarchy.java:518)
      at mondrian.rolap.RolapCubeHierarchy$CacheRolapCubeHierarchyMemberReader.getMemberChildren(RolapCubeHierarchy.java:615)
      at mondrian.rolap.SmartMemberReader.getMemberChildren(SmartMemberReader.java:176)
      at mondrian.rolap.RolapSchemaReader.internalGetMemberChildren(RolapSchemaReader.java:173)
      at mondrian.rolap.RolapSchemaReader.getMemberChildren(RolapSchemaReader.java:156)
      at mondrian.rolap.RolapSchemaReader.getMemberChildren(RolapSchemaReader.java:149)
      at mondrian.olap.DelegatingSchemaReader.getMemberChildren(DelegatingSchemaReader.java:72)
      at mondrian.olap.fun.FunUtil.getNonEmptyMemberChildren(FunUtil.java:2061)
      at mondrian.olap.fun.BuiltinFunTable$22$1.evaluateMemberList(BuiltinFunTable.java:866)
      at mondrian.calc.impl.AbstractExpCompiler$MemberListIterCalc.evaluateMemberIterable(AbstractExpCompiler.java:597)
      at mondrian.calc.impl.AbstractMemberIterCalc.evaluate(AbstractMemberIterCalc.java:52)
      at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:732)
      at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:575)
      at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:541)
      at mondrian.rolap.RolapResult.<init>(RolapResult.java:273)
      at mondrian.rolap.RolapConnection.execute(RolapConnection.java:565)
      ... 19 more

      Here is the unit test:

      public void testSnowFlakeNameExpressions() {
      final TestContext testContext = TestContext.createSubstitutingCube(
      "Sales",

      "<Dimension name=\"Product with inline\" foreignKey=\"product_id\">"
      + "<Hierarchy hasAll=\"true\" primaryKey=\"product_id\" primaryKeyTable=\"product\">"
      + "<Join leftKey=\"product_class_id\" rightKey=\"product_class_id\">"
      + "<Table name=\"product\"/>"
      + "<Table name=\"product_class\"/>"
      + "</Join>"
      + "<Level name=\"Product Family\" table=\"product_class\" column=\"product_family\" uniqueMembers=\"true\"/>"
      + "<Level name=\"Product Department\" table=\"product_class\" column=\"product_department\" uniqueMembers=\"false\"/>"
      + "<Level name=\"Product Category\" table=\"product_class\" column=\"product_category\" uniqueMembers=\"false\"/>"
      + "<Level name=\"Product Subcategory\" table=\"product_class\" column=\"product_subcategory\" uniqueMembers=\"false\"/>"
      + "<Level name=\"Brand Name\" table=\"product\" column=\"brand_name\" uniqueMembers=\"false\"/>"
      + "<Level name=\"Product Name\" table=\"product\" column=\"product_name\" uniqueMembers=\"true\">"
      + "<NameExpression><SQL dialect=\"mysql\">`product_name`</SQL>"
      + "</NameExpression>"
      + "</Level>"
      + "</Hierarchy>"
      + "</Dimension>");

      testContext.assertQueryReturns(
      "select {[Product with inline].[All Product with inlines].[Drink].[Dairy].[Dairy].[Milk].[Club].Children}

      on columns from [Sales]",
      "Axis #0:\n"
      + "{}\n"
      + "Axis #1:\n"
      + "

      {[Product with inline].[All Product with inlines]}

      \n"
      + "Row #0: 266,773\n");
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                wgorman Will Gorman (Inactive)
              • Votes:
                4 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: