java.lang.NullPointerException

Pentaho BI Platform Tracking | Julian Hyde | 10 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    A RolapStarPredicate sometimes has a null RolapStar.Column value. We would like to make this field mandatory, so that predicates can generate SQL for themselves in a self-contained fashion using the void RolapColumnPredicate.toSql(SqlQuery,StringBuilder) method. Currently we workaround this issue by supplying a fake column if the column is null. To reproduce, set Bug1767775Fixed = true Bug<thisbug>Fixed = true in Bug.java and run BasicQueryTest.testCountDistinct, and you get java.lang.NullPointerException at mondrian.rolap.agg.ValueColumnPredicate.toSql(ValueColumnPredicate.java:134) at mondrian.rolap.RolapStar$Column.createInExpr(RolapStar.java:1133) at mondrian.rolap.SqlConstraintUtils.generateSingleValueInExpr(SqlConstraintUtils.java:883) at mondrian.rolap.SqlConstraintUtils.addMemberConstraint(SqlConstraintUtils.java:304) at mondrian.rolap.SqlConstraintUtils.addMemberConstraint(SqlConstraintUtils.java:227) at mondrian.rolap.DefaultMemberChildrenConstraint.addMemberConstraint(DefaultMemberChildrenConstraint.java:44) at mondrian.rolap.SqlMemberSource.makeChildMemberSql(SqlMemberSource.java:498) at mondrian.rolap.SqlMemberSource.getMemberChildren2(SqlMemberSource.java:707) at mondrian.rolap.SqlMemberSource.getMemberChildren(SqlMemberSource.java:641) at mondrian.rolap.SqlMemberSource.getMemberChildren(SqlMemberSource.java:616) at mondrian.rolap.SmartMemberReader.readMemberChildren(SmartMemberReader.java:279) at mondrian.rolap.SmartMemberReader.getMemberChildren(SmartMemberReader.java:244) at mondrian.rolap.SmartMemberReader.getMemberChildren(SmartMemberReader.java:211) at mondrian.rolap.RolapSchemaReader.internalGetMemberChildren(RolapSchemaReader.java:150) at mondrian.rolap.RolapSchemaReader.lookupMemberChildByName(RolapSchemaReader.java:306) at mondrian.olap.MemberBase.lookupChild(MemberBase.java:129) at mondrian.rolap.RolapSchemaReader.getElementChild(RolapSchemaReader.java:253) at mondrian.olap.Util.lookupCompound(Util.java:510) at mondrian.rolap.RolapSchemaReader.lookupCompound(RolapSchemaReader.java:287) at mondrian.rolap.RolapCube$RolapCubeSchemaReader.getMemberByUniqueName(RolapCube.java:2448) at mondrian.rolap.RolapCube$RolapCubeSchemaReader.getMemberByUniqueName(RolapCube.java:2440) at mondrian.rolap.RolapSchema.createRole(RolapSchema.java:530) at mondrian.rolap.RolapSchema.load(RolapSchema.java:445) at mondrian.rolap.RolapSchema.load(RolapSchema.java:323) at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:214) at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:78) at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:867) at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:682) at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:149) at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:80) at mondrian.olap.DriverManager.getConnection(DriverManager.java:190) at mondrian.olap.DriverManager.getConnection(DriverManager.java:131) at mondrian.test.TestContext.getFoodMartConnection(TestContext.java:211) at mondrian.test.TestContext.getConnection(TestContext.java:192) at mondrian.test.TestContext.executeQuery(TestContext.java:388) at mondrian.test.TestContext.assertQueryReturns(TestContext.java:615) at mondrian.test.FoodMartTestCase.assertQueryReturns(FoodMartTestCase.java:124) at mondrian.test.BasicQueryTest.testCountDistinct(BasicQueryTest.java:2915) Assigning to Richard because of this bug's similarity with bug 1767775 "Predicate references RolapStar.Column when used in AggStar".

    Pentaho BI Platform Tracking | 10 years ago | Julian Hyde
    java.lang.NullPointerException
  2. 0

    A RolapStarPredicate sometimes has a null RolapStar.Column value. We would like to make this field mandatory, so that predicates can generate SQL for themselves in a self-contained fashion using the void RolapColumnPredicate.toSql(SqlQuery,StringBuilder) method. Currently we workaround this issue by supplying a fake column if the column is null. To reproduce, set Bug1767775Fixed = true Bug<thisbug>Fixed = true in Bug.java and run BasicQueryTest.testCountDistinct, and you get java.lang.NullPointerException at mondrian.rolap.agg.ValueColumnPredicate.toSql(ValueColumnPredicate.java:134) at mondrian.rolap.RolapStar$Column.createInExpr(RolapStar.java:1133) at mondrian.rolap.SqlConstraintUtils.generateSingleValueInExpr(SqlConstraintUtils.java:883) at mondrian.rolap.SqlConstraintUtils.addMemberConstraint(SqlConstraintUtils.java:304) at mondrian.rolap.SqlConstraintUtils.addMemberConstraint(SqlConstraintUtils.java:227) at mondrian.rolap.DefaultMemberChildrenConstraint.addMemberConstraint(DefaultMemberChildrenConstraint.java:44) at mondrian.rolap.SqlMemberSource.makeChildMemberSql(SqlMemberSource.java:498) at mondrian.rolap.SqlMemberSource.getMemberChildren2(SqlMemberSource.java:707) at mondrian.rolap.SqlMemberSource.getMemberChildren(SqlMemberSource.java:641) at mondrian.rolap.SqlMemberSource.getMemberChildren(SqlMemberSource.java:616) at mondrian.rolap.SmartMemberReader.readMemberChildren(SmartMemberReader.java:279) at mondrian.rolap.SmartMemberReader.getMemberChildren(SmartMemberReader.java:244) at mondrian.rolap.SmartMemberReader.getMemberChildren(SmartMemberReader.java:211) at mondrian.rolap.RolapSchemaReader.internalGetMemberChildren(RolapSchemaReader.java:150) at mondrian.rolap.RolapSchemaReader.lookupMemberChildByName(RolapSchemaReader.java:306) at mondrian.olap.MemberBase.lookupChild(MemberBase.java:129) at mondrian.rolap.RolapSchemaReader.getElementChild(RolapSchemaReader.java:253) at mondrian.olap.Util.lookupCompound(Util.java:510) at mondrian.rolap.RolapSchemaReader.lookupCompound(RolapSchemaReader.java:287) at mondrian.rolap.RolapCube$RolapCubeSchemaReader.getMemberByUniqueName(RolapCube.java:2448) at mondrian.rolap.RolapCube$RolapCubeSchemaReader.getMemberByUniqueName(RolapCube.java:2440) at mondrian.rolap.RolapSchema.createRole(RolapSchema.java:530) at mondrian.rolap.RolapSchema.load(RolapSchema.java:445) at mondrian.rolap.RolapSchema.load(RolapSchema.java:323) at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:214) at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:78) at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:867) at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:682) at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:149) at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:80) at mondrian.olap.DriverManager.getConnection(DriverManager.java:190) at mondrian.olap.DriverManager.getConnection(DriverManager.java:131) at mondrian.test.TestContext.getFoodMartConnection(TestContext.java:211) at mondrian.test.TestContext.getConnection(TestContext.java:192) at mondrian.test.TestContext.executeQuery(TestContext.java:388) at mondrian.test.TestContext.assertQueryReturns(TestContext.java:615) at mondrian.test.FoodMartTestCase.assertQueryReturns(FoodMartTestCase.java:124) at mondrian.test.BasicQueryTest.testCountDistinct(BasicQueryTest.java:2915) Assigning to Richard because of this bug's similarity with bug 1767775 "Predicate references RolapStar.Column when used in AggStar".

    Pentaho BI Platform Tracking | 10 years ago | Julian Hyde
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at mondrian.rolap.agg.ValueColumnPredicate.toSql()
    2. mondrian.rolap.agg
      ValueColumnPredicate.toSql
      1. mondrian.rolap.agg.ValueColumnPredicate.toSql(ValueColumnPredicate.java:134)
      1 frame
    3. mondrian.rolap
      RolapSchemaReader.lookupMemberChildByName
      1. mondrian.rolap.RolapStar$Column.createInExpr(RolapStar.java:1133)
      2. mondrian.rolap.SqlConstraintUtils.generateSingleValueInExpr(SqlConstraintUtils.java:883)
      3. mondrian.rolap.SqlConstraintUtils.addMemberConstraint(SqlConstraintUtils.java:304)
      4. mondrian.rolap.SqlConstraintUtils.addMemberConstraint(SqlConstraintUtils.java:227)
      5. mondrian.rolap.DefaultMemberChildrenConstraint.addMemberConstraint(DefaultMemberChildrenConstraint.java:44)
      6. mondrian.rolap.SqlMemberSource.makeChildMemberSql(SqlMemberSource.java:498)
      7. mondrian.rolap.SqlMemberSource.getMemberChildren2(SqlMemberSource.java:707)
      8. mondrian.rolap.SqlMemberSource.getMemberChildren(SqlMemberSource.java:641)
      9. mondrian.rolap.SqlMemberSource.getMemberChildren(SqlMemberSource.java:616)
      10. mondrian.rolap.SmartMemberReader.readMemberChildren(SmartMemberReader.java:279)
      11. mondrian.rolap.SmartMemberReader.getMemberChildren(SmartMemberReader.java:244)
      12. mondrian.rolap.SmartMemberReader.getMemberChildren(SmartMemberReader.java:211)
      13. mondrian.rolap.RolapSchemaReader.internalGetMemberChildren(RolapSchemaReader.java:150)
      14. mondrian.rolap.RolapSchemaReader.lookupMemberChildByName(RolapSchemaReader.java:306)
      14 frames
    4. mondrian.olap
      MemberBase.lookupChild
      1. mondrian.olap.MemberBase.lookupChild(MemberBase.java:129)
      1 frame
    5. mondrian.rolap
      RolapSchemaReader.getElementChild
      1. mondrian.rolap.RolapSchemaReader.getElementChild(RolapSchemaReader.java:253)
      1 frame
    6. mondrian.olap
      Util.lookupCompound
      1. mondrian.olap.Util.lookupCompound(Util.java:510)
      1 frame
    7. mondrian.rolap
      RolapConnection.<init>
      1. mondrian.rolap.RolapSchemaReader.lookupCompound(RolapSchemaReader.java:287)
      2. mondrian.rolap.RolapCube$RolapCubeSchemaReader.getMemberByUniqueName(RolapCube.java:2448)
      3. mondrian.rolap.RolapCube$RolapCubeSchemaReader.getMemberByUniqueName(RolapCube.java:2440)
      4. mondrian.rolap.RolapSchema.createRole(RolapSchema.java:530)
      5. mondrian.rolap.RolapSchema.load(RolapSchema.java:445)
      6. mondrian.rolap.RolapSchema.load(RolapSchema.java:323)
      7. mondrian.rolap.RolapSchema.<init>(RolapSchema.java:214)
      8. mondrian.rolap.RolapSchema.<init>(RolapSchema.java:78)
      9. mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:867)
      10. mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:682)
      11. mondrian.rolap.RolapConnection.<init>(RolapConnection.java:149)
      12. mondrian.rolap.RolapConnection.<init>(RolapConnection.java:80)
      12 frames
    8. mondrian.olap
      DriverManager.getConnection
      1. mondrian.olap.DriverManager.getConnection(DriverManager.java:190)
      2. mondrian.olap.DriverManager.getConnection(DriverManager.java:131)
      2 frames
    9. mondrian.test
      BasicQueryTest.testCountDistinct
      1. mondrian.test.TestContext.getFoodMartConnection(TestContext.java:211)
      2. mondrian.test.TestContext.getConnection(TestContext.java:192)
      3. mondrian.test.TestContext.executeQuery(TestContext.java:388)
      4. mondrian.test.TestContext.assertQueryReturns(TestContext.java:615)
      5. mondrian.test.FoodMartTestCase.assertQueryReturns(FoodMartTestCase.java:124)
      6. mondrian.test.BasicQueryTest.testCountDistinct(BasicQueryTest.java:2915)
      6 frames