Julian.. or whoever can help on this.. .. <br><br>Ok.... I've attempted the following modifications, and things seem to be working - aggregate tables are being used by all linked dimensions/hierarchies rather than just the first one. As follows:
<br><br>RolapStar.java :1784 + (added)<br><br> /**<br> * Finds ALL the child tables of the fact table with the given columnName<br> * used in their left join condition. This is used by the AggTableManager
<br> * while characterizing the fact table columns. (previous only returned FIRST child)<br> */<br> public ArrayList<RolapStar.Table> findTablesWithLeftJoinCondition(<br> final String columnName)
<br> {<br> java.util.ArrayList<RolapStar.Table> tables = new java.util.ArrayList<RolapStar.Table>();<br> for (Table child : getChildren()) {<br> Condition condition =
child.joinCondition;<br> if (condition != null) {<br> if (condition.left instanceof MondrianDef.Column) {<br> MondrianDef.Column mcolumn =<br> (
MondrianDef.Column) condition.left;<br> if (mcolumn.name.equals(columnName)) {<br> tables.add(child);<br> }<br> }<br> }
<br><br>and AggTableManager.java: 482 - change<br> RolapStar.Table rTable =<br> star.getFactTable().findTableWithLeftJoinCondition(cname);<br> if (rTable != null) {<br>
JdbcSchema.Table.Column.Usage usage =<br>
factColumn.newUsage(JdbcSchema.UsageType.FOREIGN_KEY);<br>
usage.setSymbolicName("FOREIGN_KEY");<br>
usage.rTable = rTable;<br>
}<br>to<br><br> ArrayList<RolapStar.Table> rTables = <br> star.getFactTable().findTablesWithLeftJoinCondition(cname);<br> if (rTables != null) {
<br> for (RolapStar.Table rTable : rTables){<br> JdbcSchema.Table.Column.Usage usage =<br> factColumn.newUsage(JdbcSchema.UsageType.FOREIGN_KEY);<br>
usage.setSymbolicName("FOREIGN_KEY");<br> usage.rTable = rTable;<br> }<br> }<br><br> }<br> return (tables.size()==0?null:tables);<br>
}<br><br>So... my question is.. did I break anything.. or caused some instability? :) If not... can any core developers take a lok and see if this is reasonable, or if it goes against some basic principle? I checked the resulting RolapStar (with toString()) and it seems okay to me...
<br><br>Cheers<br>Ati<br><br>oh.. and I was wrong.. findTableWithLeftCondition is NOT identical (different parameters), and is referenced from the validate method of ExplicitRules.java..<br><br><div><span class="gmail_quote">
On 10/22/07, <b class="gmail_sendername">Ati Rosselet</b> <<a href="mailto:ati.rosselet@gmail.com">ati.rosselet@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
>From delving into the Mondrian code, it appears to have something to do with the following:<br><br>findTableWithLeftJoinCondition in RolapStar.java (called from AggTableManager.java:483) ..there is also a findTableWithLeftCondition which seems to be identical.. and unused.. btw.. anyhow.. if there is a column in the Star (here pillangoperiodid) that maps to more than one dimension/hierarchy.. this function returns only the FIRST match...(creating only one usage entry) leaving all other matching dimensions/hierarchies out in the cold. I assume there is more to this.. and will keep digging... I'm guessing it may be a combination of this with the subsequent agg matching (maybe again only checking for first somewhere?)
<br><br>Cheers<br><span class="sg">Ati<br><br><br></span><div><span class="q"><span class="gmail_quote">On 10/18/07, <b class="gmail_sendername">Julian Hyde</b> <<a href="mailto:julianhyde@speakeasy.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
julianhyde@speakeasy.net</a>> wrote:</span></span><span class="q"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font color="#000080" face="Verdana" size="2">Can you clarify? Period and Period2 are based on the same
dimension table, with the same primary key, and the same foreign key from the
fact table? </font></span></div>
<div dir="ltr" align="left"><span><font color="#000080" face="Verdana" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#000080" face="Verdana" size="2">At this point, it sounds like a bug in the aggregate table
recognizer algorithm. There may be a bug logged already. If you can convert into
a testcase on the foodmart schema that would help.</font></span></div>
<div dir="ltr" align="left"><span><font color="#000080" face="Verdana" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#000080" face="Verdana" size="2">Julian</font></span></div><br></div><a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
</a><br><br></blockquote></span></div><br>
</blockquote></div><br>