Mondrian: 无法使用聚合表

59

我一直在努力让聚合表正常工作。这是我的事实表的样子:

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
那是蒙德里安的东西。这是他们所谓的固定层次结构的非标准引用方式。现在,他们已经理解了两种引用层次结构的方式。我只是使用的略旧版本。但是,请将其视为[EmploymentDate] . [yearQuarterMonth]作为层次结构而不是级别。 - chubbsondubs
1个回答

1
可能是因为mondrian.rolap.aggregates.Read设置为true,而mondrian.rolap.aggregates.Use设置为false。请设置mondrian.rolap.aggregates.Use=true并检查。参考:http://mondrian.pentaho.com/documentation/configuration.php 如果不是这种情况,请附上所有与聚合表相关的属性和完整的立方体定义XML。

不,我已经将两个都设置为true,并且已经附加了我的属性文件。 - chubbsondubs
我也附上了属性。 - chubbsondubs

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接