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

NullPointerException on NON EMPTY crossjoin in virtualcube

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: High
    • Resolution: Duplicate
    • Affects Version/s: 3.5.0 GA (4.8.0 GA Suite Release)
    • Component/s: None
    • Labels:
      None
    • Story Points:
      2
    • 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

      Attached is a test method which fails with a NullPointerException. We have reduced the test to the point where this error happens.

      Test method in AccessControlTest.java :

      public void testVirtualCubeNonEmptyCrossJoin()

      { TestContext testContext = TestContext.instance().create( null, "<Cube name=\"SalesTest\">" + " <Table name=\"sales_fact_1997\" />" + " <Dimension name=\"Promotions\" foreignKey=\"promotion_id\">" + " <Hierarchy hasAll=\"true\" allMemberName=\"All Promotions\" primaryKey=\"promotion_id\" defaultMember=\"[All Promotions]\">" + " <Table name=\"promotion\"/>" + " <Level name=\"Promotion Name\" column=\"promotion_name\" uniqueMembers=\"true\"/>" + " </Hierarchy>" + " </Dimension>" + " <Dimension name=\"Gender\" foreignKey=\"customer_id\">" + " <Hierarchy hasAll=\"true\" allMemberName=\"All Gender\" primaryKey=\"customer_id\">" + " <Table name=\"customer\"/>" + " <Level name=\"Gender\" column=\"gender\" uniqueMembers=\"true\"/>" + " </Hierarchy>" + " </Dimension>" + " <Measure name=\"SalesTest Unit Sales\" column=\"unit_sales\" aggregator=\"sum\" formatString=\"Standard\"/>" + "</Cube>", "<VirtualCube name=\"VirtualSalesTest\">" + " <CubeUsages>" + " <CubeUsage cubeName=\"SalesTest\" />" + " </CubeUsages>" + " <VirtualCubeDimension cubeName=\"SalesTest\" name=\"Promotions\" />" + " <VirtualCubeDimension cubeName=\"SalesTest\" name=\"Gender\" />" + " <VirtualCubeMeasure cubeName=\"SalesTest\" name=\"[Measures].[SalesTest Unit Sales]\" />" + "</VirtualCube>", null, null, "<Role name=\"AccountRole1\">" + " <SchemaGrant access=\"none\">" + " <CubeGrant cube=\"VirtualSalesTest\" access=\"all\">" + " <HierarchyGrant hierarchy=\"[Promotions]\" access=\"custom\" rollupPolicy=\"partial\">" + " <MemberGrant member=\"[Promotions].[Coupon Spectacular]\" access=\"all\"/>" + " </HierarchyGrant>" + " </CubeGrant>" + " </SchemaGrant>" + "</Role>").withRole("AccountRole1"); testContext.assertQueryReturns( "select non empty crossjoin([Promotions].Members, [Gender].Members) on 0 from [VirtualSalesTest]", "FIXME"); }

      Stacktrace:

      mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while executing query [select NON EMPTY Crossjoin([Promotions].Members, [Gender].Members) ON COLUMNS
      from [VirtualSalesTest]
      ]
      at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:972)
      at mondrian.olap.Util.newInternal(Util.java:2414)
      at mondrian.olap.Util.newError(Util.java:2430)
      at mondrian.rolap.RolapConnection.executeInternal(RolapConnection.java:706)
      at mondrian.rolap.RolapConnection.access$000(RolapConnection.java:51)
      at mondrian.rolap.RolapConnection$1.call(RolapConnection.java:622)
      at mondrian.rolap.RolapConnection$1.call(RolapConnection.java:620)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
      Caused by: java.lang.NullPointerException
      at mondrian.rolap.SqlConstraintUtils.joinLevelTableToFactTable(SqlConstraintUtils.java:684)
      at mondrian.rolap.SqlConstraintUtils.addRoleAccessConstraints(SqlConstraintUtils.java:299)
      at mondrian.rolap.SqlConstraintUtils.addContextConstraint(SqlConstraintUtils.java:215)
      at mondrian.rolap.SqlContextConstraint.addConstraint(SqlContextConstraint.java:308)
      at mondrian.rolap.SqlTupleReader.generateSelectForLevels(SqlTupleReader.java:923)
      at mondrian.rolap.SqlTupleReader.makeLevelMembersSql(SqlTupleReader.java:784)
      at mondrian.rolap.SqlTupleReader.prepareTuples(SqlTupleReader.java:390)
      at mondrian.rolap.SqlTupleReader.readMembers(SqlTupleReader.java:506)
      at mondrian.rolap.SqlMemberSource.getMembersInLevel(SqlMemberSource.java:508)
      at mondrian.rolap.SmartMemberReader.getMembersInLevel(SmartMemberReader.java:146)
      at mondrian.rolap.RolapCubeHierarchy$CacheRolapCubeHierarchyMemberReader.getMembersInLevel(RolapCubeHierarchy.java:727)
      at mondrian.rolap.RestrictedMemberReader.getMembersInLevel(RestrictedMemberReader.java:241)
      at mondrian.rolap.SubstitutingMemberReader.getMembersInLevel(SubstitutingMemberReader.java:185)
      at mondrian.rolap.RolapSchemaReader.getLevelMembers(RolapSchemaReader.java:547)
      at mondrian.olap.DelegatingSchemaReader.getLevelMembers(DelegatingSchemaReader.java:242)
      at mondrian.olap.fun.FunUtil.getNonEmptyLevelMembers(FunUtil.java:2195)
      at mondrian.olap.fun.FunUtil.hierarchyMembers(FunUtil.java:2231)
      at mondrian.olap.fun.BuiltinFunTable$27$1.evaluateList(BuiltinFunTable.java:957)
      at mondrian.calc.impl.AbstractListCalc.evaluateIterable(AbstractListCalc.java:71)
      at mondrian.olap.fun.CrossJoinFunDef$CrossJoinIterCalc.evaluateIterable(CrossJoinFunDef.java:185)
      at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:875)
      at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:700)
      at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:656)
      at mondrian.rolap.RolapResult.<init>(RolapResult.java:288)
      at mondrian.rolap.RolapConnection.executeInternal(RolapConnection.java:671)
      ... 8 more

      java.lang.NullPointerException
      at mondrian.rolap.SqlConstraintUtils.joinLevelTableToFactTable(SqlConstraintUtils.java:684)
      at mondrian.rolap.SqlConstraintUtils.addRoleAccessConstraints(SqlConstraintUtils.java:299)
      at mondrian.rolap.SqlConstraintUtils.addContextConstraint(SqlConstraintUtils.java:215)
      at mondrian.rolap.SqlContextConstraint.addConstraint(SqlContextConstraint.java:308)
      at mondrian.rolap.SqlTupleReader.generateSelectForLevels(SqlTupleReader.java:923)
      at mondrian.rolap.SqlTupleReader.makeLevelMembersSql(SqlTupleReader.java:784)
      at mondrian.rolap.SqlTupleReader.prepareTuples(SqlTupleReader.java:390)
      at mondrian.rolap.SqlTupleReader.readMembers(SqlTupleReader.java:506)
      at mondrian.rolap.SqlMemberSource.getMembersInLevel(SqlMemberSource.java:508)
      at mondrian.rolap.SmartMemberReader.getMembersInLevel(SmartMemberReader.java:146)
      at mondrian.rolap.RolapCubeHierarchy$CacheRolapCubeHierarchyMemberReader.getMembersInLevel(RolapCubeHierarchy.java:727)
      at mondrian.rolap.RestrictedMemberReader.getMembersInLevel(RestrictedMemberReader.java:241)
      at mondrian.rolap.SubstitutingMemberReader.getMembersInLevel(SubstitutingMemberReader.java:185)
      at mondrian.rolap.RolapSchemaReader.getLevelMembers(RolapSchemaReader.java:547)
      at mondrian.olap.DelegatingSchemaReader.getLevelMembers(DelegatingSchemaReader.java:242)
      at mondrian.olap.fun.FunUtil.getNonEmptyLevelMembers(FunUtil.java:2195)
      at mondrian.olap.fun.FunUtil.hierarchyMembers(FunUtil.java:2231)
      at mondrian.olap.fun.BuiltinFunTable$27$1.evaluateList(BuiltinFunTable.java:957)
      at mondrian.calc.impl.AbstractListCalc.evaluateIterable(AbstractListCalc.java:71)
      at mondrian.olap.fun.CrossJoinFunDef$CrossJoinIterCalc.evaluateIterable(CrossJoinFunDef.java:185)
      at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:875)
      at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:700)
      at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:656)
      at mondrian.rolap.RolapResult.<init>(RolapResult.java:288)
      at mondrian.rolap.RolapConnection.executeInternal(RolapConnection.java:671)
      at mondrian.rolap.RolapConnection.access$000(RolapConnection.java:51)
      at mondrian.rolap.RolapConnection$1.call(RolapConnection.java:622)
      at mondrian.rolap.RolapConnection$1.call(RolapConnection.java:620)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
      Failure Count : 0

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mjbroek Martijn van den Broek
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: