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

NullPointer Exception After Adding Closure Table On Mondrian Xml Schema (Mondrian 4)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: High
    • Resolution: Incomplete
    • Affects Version/s: 5.3.0.1 GA
    • Fix Version/s: Backlog - Mondrian 4.0
    • Labels:
      None
    • Environment:
      I'm merely loading the mondrian driver (version 4.2.0.2 within a java application.
    • Story Points:
      0
    • 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.
    • Operating System/s:
      Windows 8.1 (64 bit)

      Description

      The XML and SQL definitions:

      <PhysicalSchema>
      <Table name='space_dimension'>
      <Key>
      <Column name='space_id'/>
      </Key>
      <ColumnDefs>
      <ColumnDef name='space_id' type='Integer'/>
      <ColumnDef name='parent_space_id' type='Integer'/>
      </ColumnDefs>
      </Table>
      <Table name='space_hierarchy_bridge'>
      <Key>
      <Column name='space_id'/>
      </Key>
      <ColumnDefs>
      <ColumnDef name='space_id' type='Integer'/>
      <ColumnDef name='parent_space_id' type='Integer'/>
      <ColumnDef name='levels_from_top' type='Integer'/>
      </ColumnDefs>
      </Table>
      <Link source='space_dimension'
      target='space_hierarchy_bridge'>
      <ForeignKey>
      <Column name='space_id'/>
      </ForeignKey>
      </Link>
      </PhysicalSchema>

      <Dimension name='Space'
      table='space_dimension' key='Space Id'>
      <Attributes>
      <Attribute name='Parent Space Id'
      keyColumn='parent_space_id'/>
      <Attribute name='Space Id' keyColumn='space_id'/>
      </Attributes>
      <Hierarchies>
      <Hierarchy name='Space'
      primaryKey="space_id">
      <Level attribute='Parent Space Id'/>
      <Level attribute='Space Name'
      parentAttribute='Parent Space Id'
      nullParentValue='0'>
      <Closure table='space_hierarchy_bridge'
      parentColumn='parent_space_id'
      childColumn='space_id'
      distanceColumn='levels_from_top'/>
      </Level>
      </Hierarchy>
      </Hierarchies>
      </Dimension>

      CREATE TABLE space_dimension(
      parent_space_id BIGINT NOT NULL,
      space_id BIGINT NOT NULL,
      CONSTRAINT pk_space_dimension PRIMARY KEY (space_id)
      );

      CREATE TABLE space_hierarchy_bridge(
      parent_space_id BIGINT NOT NULL,
      space_id BIGINT NOT NULL,
      levels_from_top INT NOT NULL,
      FOREIGN KEY (space_id) REFERENCES space_dimension (space_id)
      );

      The error that shows up has soon as i load the mondrian library:

      java.lang.NullPointerException at
      mondrian.rolap.RolapSchema$PhysPathBuilder.(RolapSchema.java:2554) at
      mondrian.rolap.RolapSchemaLoader.registerExpr
      (RolapSchemaLoader.java:2219)
      at mondrian.rolap.RolapSchemaLoader.registerAttribute
      (RolapSchemaLoader.java:2165)
      at mondrian.rolap.RolapSchemaLoader.registerLevel
      (RolapSchemaLoader.java:2150)
      at mondrian.rolap.RolapSchemaLoader.registerHierarchy
      (RolapSchemaLoader.java:2139)
      at mondrian.rolap.RolapSchemaLoader.registerDimension
      (RolapSchemaLoader.java:2127)
      at mondrian.rolap.RolapSchemaLoader.createCube
      (RolapSchemaLoader.java:1907)
      at mondrian.rolap.RolapSchemaLoader.sharedDimension
      (RolapSchemaLoader.java:3062)
      at mondrian.rolap.RolapSchemaLoader.access$500
      (RolapSchemaLoader.java:62)
      at mondrian.rolap.RolapSchemaLoader$5.apply
      (RolapSchemaLoader.java:2731)
      at mondrian.rolap.RolapSchemaLoader.loadStage2
      (RolapSchemaLoader.java:426)
      at mondrian.rolap.RolapSchemaLoader.loadStage1
      (RolapSchemaLoader.java:336)
      at mondrian.rolap.RolapSchemaLoader.loadStage0
      (RolapSchemaLoader.java:272)
      at mondrian.rolap.RolapSchemaLoader.createSchema
      (RolapSchemaLoader.java:4303)
      at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:210)
      at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:62)
      at mondrian.rolap.RolapConnection.(RolapConnection.java:160)
      at mondrian.rolap.RolapConnection.(RolapConnection.java:84)
      at mondrian.olap.DriverManager.getConnection(DriverManager.java:112)
      at mondrian.olap.DriverManager.getConnection(DriverManager.java:68)
      at mondrian.olap4j.MondrianOlap4jConnection
      .(MondrianOlap4jConnection.java:153)
      at mondrian.olap4j.FactoryJdbc4Plus$AbstractConnection
      .(FactoryJdbc4Plus.java:323)
      at mondrian.olap4j.FactoryJdbc41Impl$MondrianOlap4jConnectionJdbc41
      .(FactoryJdbc41Impl.java:118)
      at mondrian.olap4j.FactoryJdbc41Impl.newConnection
      (FactoryJdbc41Impl.java:32)
      at mondrian.olap4j.MondrianOlap4jDriver.connect
      (MondrianOlap4jDriver.java:139)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at energydw.olap.application.Application.init(Application.java:148)

      Everything was working fine before i added the closure table definition.

      The library is creating all the relations between facts, dimensions, and tables (including relations between fact tables and the closure table), but it does not create a relation between space dimension and its closure table...

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              JCavalheiro José Cavalheiro
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: