5
votes

I'm trying to learn how to build a BI stack, but I'm stuck at understanding what part of the process failed :

  1. Designing a star schema : done
  2. Loading data from my OLTP database (MySQL) to my star database (MySQL too) : done with Pentaho Data Integration
  3. Making a Mondrian XML description the cube : done with Mondrian Schema Workbench
  4. Setuping a Saiku server with the correct configuration using the Mondrian XML description and the MySQL star database : done

Result : no cube appears in Saiku. I don't know from which element this might come from. Step 2 is correct, since I can run this part.

Here's my star schema :

CREATE TABLE IF NOT EXISTS `dim_date` (
  `date_id` int(11) NOT NULL AUTO_INCREMENT,
  `date` datetime DEFAULT NULL,
  `month` varchar(3) DEFAULT NULL,
  `year` varchar(4) DEFAULT NULL,
  PRIMARY KEY (`date_id`),
  KEY `idx_dim_date_lookup` (`date`,`month`,`year`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `dim_sector` (
  `sector_id` int(11) NOT NULL AUTO_INCREMENT,
  `sector` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`sector_id`),
  KEY `idx_dim_sector_lookup` (`sector`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `dim_size` (
  `size_id` int(11) NOT NULL AUTO_INCREMENT,
  `size` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`size_id`),
  KEY `idx_dim_size_lookup` (`size`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `fact_companies` (
  `fact_id` int(11) NOT NULL AUTO_INCREMENT,
  `count` int(11) NOT NULL,
  `date_id` int(11) NOT NULL,
  `sector_id` int(11) NOT NULL,
  `size_id` int(11) NOT NULL,
  PRIMARY KEY (`fact_id`),
  KEY `date_id` (`date_id`),
  KEY `sector_id` (`sector_id`),
  KEY `size_id` (`size_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1;

ALTER TABLE `fact_companies`
  ADD CONSTRAINT `fact_companies_ibfk_1` FOREIGN KEY (`date_id`) REFERENCES `dim_date` (`date_id`),
  ADD CONSTRAINT `fact_companies_ibfk_2` FOREIGN KEY (`sector_id`) REFERENCES `dim_sector` (`sector_id`),
  ADD CONSTRAINT `fact_companies_ibfk_3` FOREIGN KEY (`size_id`) REFERENCES `dim_size` (`size_id`);

My Mondrian XML is (size is missing) :

<Schema name="New Schema1">
  <Cube name="companies_cube" visible="true" cache="true" enabled="true">
    <Table name="fact_companies">
    </Table>
    <Dimension type="TimeDimension" visible="true" foreignKey="date_id" name="date">
      <Hierarchy name="All" visible="true" hasAll="true" allMemberName="all" allMemberCaption="all" allLevelName="all">
        <Level name="Date" visible="true" table="dim_date" column="date" nameColumn="date" uniqueMembers="false">
        </Level>
        <Level name="Month" visible="true" table="dim_date" column="month" nameColumn="month" uniqueMembers="false">
        </Level>
        <Level name="Year" visible="true" table="dim_date" column="year" nameColumn="year" uniqueMembers="false">
        </Level>
      </Hierarchy>
    </Dimension>
    <Dimension type="StandardDimension" visible="true" foreignKey="sector_id" name="Sector">
      <Hierarchy name="Sector" visible="true" hasAll="true" primaryKey="sector_id" primaryKeyTable="sector_id">
        <Level name="Sector" visible="true" table="dim_sector" column="sector_id" nameColumn="sector" uniqueMembers="false">
        </Level>
      </Hierarchy>
    </Dimension>
    <Measure name="count companies" column="count" aggregator="sum" visible="true">
    </Measure>
  </Cube>
</Schema>

My connection with Saiku server is done through :

type=OLAP
name=test
driver=mondrian.olap4j.MondrianOlap4jDriver
location=jdbc:mondrian:Jdbc=jdbc:mysql://192.168.1.43/testdb;Catalog=res:test/testdb.xml;JdbcDrivers=com.mysql.jdbc.Driver;
username=test
password=test

I wrote this one considering the foodmart sample provided and the documentation of saiku.

Where should I look ? What can I do to see what is not working ? What is the professional way of developing a BI infrastructure ?

1
Check the saiku server logs - see if you can see if it's finding the file. The problem is either saiku is not finding the mondrian xml, or that it does not validate for some reason. ( Saiku will not accept invalid schemas ). Alternatively try ##saiku on freenode IRC for instant help!Codek
I've checked in the log files, there's no mention of my file.AsTeR
Exactly what I am at right now ... with regards to Pentaho's BI Suite the correct answer to "What is the professional way of developing a BI infrastructure ?" is to pay them for support :D No way - I'll stick through no matter what it takes and turn it into a blog post.Raffael
@Raffael It's just the kind of thing at which you have to throw time and hard work. It took me a lot of time but I get something working. I have this feeling that this is the kind of "pay for consultancy/support" thing. Good luck!AsTeR
doing my best to make it available to the folks: joyofdata.de/blog/…Raffael

1 Answers

3
votes

I'm not 100 % operational since query failed to be executed but saiku now loads.

First point : tomcat/saiku/catalina.out contains the interesting log information for debugging. Second point : location string in the saiku configuration did point to a missing file, that didn't help. Third point : dimension tables should be mentionned in Mondrian's XML (the correct version follows).

<Schema name="New Schema1">
  <Cube name="companies_cube" visible="true" cache="true" enabled="true">
    <Table name="fact_companies">
    </Table>
    <Dimension type="TimeDimension" visible="true" foreignKey="date_id" highCardinality="false" name="date">
      <Hierarchy name="Date" visible="true" hasAll="true" allMemberName="all dates" allMemberCaption="all dates" allLevelName="all dates">
        <Table name="dim_date">
        </Table>
        <Level name="Year" visible="true" table="dim_date" column="year" nameColumn="year" type="String" uniqueMembers="false" levelType="TimeYears" hideMemberIf="Never">
        </Level>
        <Level name="Month" visible="true" table="dim_date" column="month" nameColumn="month" type="String" uniqueMembers="false" levelType="TimeMonths" hideMemberIf="Never">
        </Level>
        <Level name="Date" visible="true" table="dim_date" column="date" nameColumn="date" type="String" uniqueMembers="false" levelType="TimeDays" hideMemberIf="Never">
        </Level>
      </Hierarchy>
    </Dimension>
    <Dimension type="StandardDimension" visible="true" foreignKey="sector_id" highCardinality="false" name="Sector">
      <Hierarchy name="Sector" visible="true" hasAll="true" allMemberName="all sector" allMemberCaption="all sector" allLevelName="all sector" primaryKey="sector_id">
        <Table name="dim_sector" alias="">
        </Table>
        <Level name="Sector" visible="true" table="dim_sector" column="sector_id" nameColumn="sector" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
        </Level>
      </Hierarchy>
    </Dimension>
    <Measure name="count companies" column="count" aggregator="sum" visible="true">
    </Measure>
  </Cube>
</Schema>