<html><head><META content="text/html; charset=us-ascii" http-equiv="Content-Type">



<meta content="text/html; charset=us-ascii" http-equiv=Content-Type>
<meta content="Microsoft Word 11 (filtered medium)" name=Generator>
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head><BODY>
<DIV>

<div class=Section1>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>Hi all.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>I believe there is a bug in the implementation of
aggregation tables where one of the aggregated dimensions is a parent/child
hierarchy with a closure table.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>The description of the bug is as follows:<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>1. When loading the RolapCube data for a cube (for example,
the HR cube in FoodMart), the code encounters a Closure delcaration in the XML
for the parent/child Level.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>2. This event triggers the RolapCubeLevel.init() method to
create a &#8220;closedPeer&#8221; reference to a new RolapCubeLevel based on a
&#8216;trick&#8217; dimension called &#8220;Employees$Closure&#8221;.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>3. This trick dimension is created with the RolapCube as
it&#8217;s parent, but it is never actually &#8216;registered&#8217; with the
RolapCube by adding it to the RolapCube.dimensions Dimension[] array.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>4. When the Aggregation Loader scans tables in the system to
identify potential Aggregation tables, it checks each candidate table against
iether the &#8216;search patterns&#8217;, or any explicitly declared AggName
definitions for the fact table.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>5. in the case of an explicit AggName definition, the code
identifies which columns on the candidate aggregation table match columns on
the fact table (Fact count, measures, levels, etc.).<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>6. the mechanism it uses (in
mondrian.rolap.aggmatcher.Recognizer.checkLevels()) to identify levels is to
scan all available cubes, and each dimension and hierarchy in those cubes. The
documentation for the combined Closure/Aggregation concept indicates that the
Hierarchy will be called [Employees$Closure], but, because, in step 3, the
trick dimension is not actually registered with the cube, the hierarchy is
never available to be scanned. As a result, the explicit aggregation table ends
up with columns that have no explicit usage, and causes the candidate aggregate
table to be rejected.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>7. because an explicit aggregation table is rejected, the
intitialization of Mondrian fails with &#8216;too many errors&#8217;.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>Since I have not been able to get things working, and have
tried a number of mechanisms, the following example will fail on just the first
error I describe above. It is possible that the naming convention of the way it
is supposed to work is different from the example I give.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>To reproduce the problem I invite you to change the HR cube
to:<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;Table name=&quot;salary&quot;&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;AggName name=&quot;FoodMart_HR_1&quot;&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;AggFactCount column=&quot;fact_count&quot; /&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;AggMeasure column=&quot;salary_paid&quot; name=&quot;[Measures].[Org
Salary]&quot; /&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;AggLevel column=&quot;employee_id&quot;
name=&quot;[Employees$Closure].[Closure]&quot; /&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/AggName&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/Table&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>Then, create the table:<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>CREATE TABLE &quot;FoodMart_HR_1&quot; (<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp; &quot;employee_id&quot; NUMBER(38),<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp; &quot;salary_paid&quot; NUMBER,<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp; &quot;fact_count&quot; INTEGER);<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>I am using Oracle, so forgive the DB specific statement.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>There is no need to populate the table to encounter the
problem.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>By loading the new mondrian schema you will encounter the
problem.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>For the record, I have debugged this code, and tried to
correlate the actual implementation with the documentation described here: <a href="http://mondrian.pentaho.org/documentation/aggregate_tables.php#Combined_closure_and_aggregate_tables">http://mondrian.pentaho.org/documentation/aggregate_tables.php#Combined_closure_and_aggregate_tables</a><o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>and I find that the differences are significant. The actual
names of the Hierarchies and Levels in the &#8216;trick&#8217; dimension are
significantly different to the implied values in the web page.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>Finally, I have tried to resolve the problem by modifying
the code. My initial attempt was to add the dimension to the Dimension[] array
on the cube, but this has issues with the dimension naming comvention. The
second attempt is to add a new hierarchy to the existing Employees dimension,
but the problem there is that there are &#8216;deep&#8217; problems with the
fact that the table for the closure level is &#8216;employee_closure&#8217;,
but this is not actually part of the RolapStar for the HR cube, and thus has
other issues.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>Any assistance/insight is much appreciated.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>Thanks in advance.<o:p></o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font face=Arial size=2><span style='font-size:10.0pt;
font-family:Arial'>Rolf<o:p></o:p></span></font></p>

</div>

</DIV>
<DIV>&nbsp;</DIV>
<DIV STYLE="FONT-SIZE: 9pt; FONT-FAMILY: Courier New">
<HR>

<DIV ALIGN="justify" STYLE="FONT-SIZE: 9pt; FONT-FAMILY: Courier New"><FONT FACE="Arial" SIZE="1">This email and any files transmitted with it are confidential and proprietary to Algorithmics Incorporated and its affiliates ("Algorithmics"). If received in error, use is prohibited. Please destroy, and notify sender. Sender does not waive confidentiality or privilege. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. Algorithmics does not accept liability for any errors or omissions. Any commitment intended to bind Algorithmics must be reduced to writing and signed by an authorized signatory.</FONT></DIV>
<HR>

<DIV></DIV></DIV></body></html>