我正在尝试学习如何构建BI堆栈,但我一直在理解该流程的哪个部分失败:
结果:Saiku中没有立方体。我不知道这可能来自哪个元素。第2步是正确的,因为我可以运行这部分。
这是我的明星架构:
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`);
我的Mondrian XML是(缺少大小):
<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>
我与Saiku服务器的连接是通过以下方式完成的:
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
我写了这篇文章,考虑到提供的foodmart样本和saiku的文档。
我应该在哪里看?我该怎么做才能看到什么不起作用?开发BI基础架构的专业方式是什么?
答案 0 :(得分:3)
我不是100%可操作的,因为查询未能执行但saiku现在已加载。
第一点:tomcat / saiku / catalina.out包含用于调试的有趣日志信息。第二点:saiku配置中的位置字符串确实指向丢失的文件,但没有帮助。第三点:应在Mondrian的XML中提及维度表(下面是正确的版本)。
<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>