我一直在努力让聚合表正常工作。这是我的事实表的样子:
employment_date_id
dimension1_id
dimension2_id
dimension3_id
dimension4
dimension5
measure1
measure2
measure3
我将employment_date_id
从年份、季度和月份崩溃到只包括年份,但其他列都包括在内。这是我的聚合表的样子:
yearquartermonth_year
dimension1_id
dimension2_id
dimension3_id
dimension4
dimension5
measure1
measure2
measure3
fact_count
我只折叠日期中的年份部分,其他字段保持不变。这是我的配置:
<AggFactCount column="FACT_COUNT"/>
<AggForeignKey factColumn="dimension1_id" aggColumn="dimension1_id"/>
<AggForeignKey factColumn="dimension2_id" aggColumn="dimension2_id"/>
<AggForeignKey factColumn="dimension3_id" aggColumn="dimension3_id"/>
<AggMeasure name="[Measures].[measure1]" column="measure1"/>
<AggMeasure name="[Measures].[measure2]" column="measure2"/>
<AggMeasure name="[Measures].[measure3]" column="measure3"/>
<AggLevel name="[dimension4].[dimension4]" column="dimension4"/>
<AggLevel name="[dimension5].[dimension5]" column="dimension5"/>
<AggLevel name="[EmploymentDate.yearQuarterMonth].[Year]" column="yearquartermonth_year"/>
我主要是在复制文档中第二个聚合表的示例,文档链接为这里。我的大多数列都没有折叠到表中,而是作为维度表的外键。
我尝试执行的查询类似于:
select {[Measures].[measure1]} on COLUMNS, {[EmploymentDate.yearQuarterMonth].[Year]} on ROWS from Cube1
问题是当我调试并打开日志记录时,我看到的位键如下所示:
AggStar:agg_year_employment
bk=0x00000000000000000000000000000000000000000000000111111111101111100000000000000000000000000000000000000000000000000000000000000000
fbk=0x00000000000000000000000000000000000000000000000000000001101111100000000000000000000000000000000000000000000000000000000000000000
mbk=0x00000000000000000000000000000000000000000000000111111110000000000000000000000000000000000000000000000000000000000000000000000000
我的查询位模式是:
Foreign columns bit key=0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
Measure bit key= 0x00000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000
所以我的聚合表被跳过了。然而,这些都是被折叠到表中的确切列。但是查询和聚合表之间的比特位置不匹配。我发现另一件奇怪的事情是,部分列被折叠到表中,但所有的AggForeignKeys
并没有作为比特包含,所以如果我使用这些列进行查询,这个聚合表就会被跳过?这与我的计划相反。我的计划是只要你在年度边界上进行查询,就使用这个聚合表。我不明白为什么这不起作用,为什么构建比特键时失败了。我尝试调试mondrian代码,但弄清楚哪个列映射到比特键中的哪个位置并不明显。我觉得这不应该那么难,但是所有的资料都没有很好地解释这个问题。而且这个聚合表结构真的很难理解。
我做错了什么?为什么我的解决方案不起作用?
更新 这是我的mondrian.properties文件:
mondrian.jdbcDrivers=com.mysql.jdbc.Driver,oracle.jdbc.driver.OracleDriver
mondrian.rolap.generate.formatted.sql=true
mondrian.rolap.localePropFile=locale.properties
mondrian.rolap.aggregates.Use=true
mondrian.rolap.aggregates.Read=true
mondrian.trace.level=2
mondrian.drillthrough.enable=true
[EmploymentDate.yearQuarterMonth]
这样的点号...这不会在后面引起某种问题吗? - whytheq