<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Ok, playing with the CsvDBTestCase stuff … pretty cool …<div><br></div><div>I'm still getting the "no table found in hierarchy" error, though.</div><div><br></div><div>My CSV file (which is definitely being read, if I muck it up I get exceptions):</div><div><div><br></div><div># non_pkey_closure_test</div><div>## TableName: non_pkey_closure_test</div><div>## ColumnNames: store_id,employee_id,supervisor_id,full_name,manager_rank</div><div>## ColumnTypes: INTEGER,INTEGER,INTEGER,VARCHAR(30),INTEGER</div><div>## NosOfRows: 4</div><div>1,11,5,"Jonathan Murraiin",1</div><div>2,29,22,"Kevin Armstrong",2</div><div>3,30,22,"Cody Goldey",3</div><div>4,15,5,"Walter Cavestany",4</div></div><div><br></div><div>My cube def:</div><div><br></div><div><div>&nbsp; &nbsp; protected String getCubeDescription() {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "&lt;Cube name=\"ClosureTest\"&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + "<span class="Apple-tab-span" style="white-space:pre">        </span>&lt;Table name=\"non_pkey_closure_test\"/&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + "<span class="Apple-tab-span" style="white-space:pre">        </span>\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &lt;Dimension name=\"Store Managers\" foreignKey=\"store_id\"&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp;&lt;Hierarchy hasAll=\"true\" allMemberName=\"All Managers\"\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; primaryKey=\"store_id\" primaryKeyTable=\"non_pkey_closure_test\"\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=\"Manager\"&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;Table name=\"employee\"/&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;Level name=\"Employee Id\" type=\"Numeric\" uniqueMembers=\"true\"\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; column=\"employee_id\" parentColumn=\"supervisor_id\"\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nameColumn=\"full_name\" nullParentValue=\"0\"&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;Closure parentColumn=\"supervisor_id\" childColumn=\"employee_id\"&gt;\n"</div><div>&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=\"employee_closure\"/&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/Closure&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/Level&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp; &nbsp; &nbsp;&lt;/Hierarchy&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp;&lt;/Dimension&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + " &nbsp; &nbsp;&lt;Measure name=\"Rank\" column=\"manager_rank\" aggregator=\"min\" formatString=\"Standard\"/&gt;\n"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + "&lt;/Cube&gt;\n";</div><div>&nbsp; &nbsp; }</div></div><div><br></div><div>Error message:</div><div><br></div><div>testNonPrimaryKeyClosure(mondrian.test.NonPrimaryKeyClosureTest)mondrian.olap.MondrianException: Mondrian Error:Internal error: no table 'non_pkey_closure_test' found in hierarchy [Store Managers.Manager]</div><div>…</div><div>at mondrian.rolap.HierarchyUsage.findJoinTable(HierarchyUsage.java:429)</div><div><br></div><div>So the exception still seems to be coming from the same spot as before, too.</div><div><br><div apple-content-edited="true">Thanks,</div><div apple-content-edited="true">Pat</div><div apple-content-edited="true"><br></div><div><div>On 2012-03-22, at 9:47 AM, Patrick Leckey wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Haven't tried CsvDBTestCase yet, was hoping it was something I was doing wrong with inline tables. &nbsp;:) &nbsp;I'll give it a shot today.<div><br></div><div>Thanks,</div><div>Pat</div><div><br><div apple-content-edited="true">On 2012-03-21, at 8:24 PM, Julian Hyde wrote:</div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">There are a few places where an InlineTable cannot be used in place of a regular table. (Not that it shouldn't -- but it's never been implemented.) I can well believe that this is one of those.<div><br></div><div>Sorry! I know it would have made it easier to write the test. InlineTable support will be better in mondrian-4, by the way.<br><div><br></div><div>Did you try extending CsvDBTestCase? That allows you to create a table at the start of the test, and drop it at the end.<br><div><br></div><div>Julian</div><div>&nbsp;<br><div><div>On Mar 21, 2012, at 1:30 PM, Patrick Leckey wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Julian,<div><br></div><div>I am working with TestContext.create() as you suggested, and am trying to accomplish this with an inline table (since I need data not in the FoodMart SQL). &nbsp;It looks promising, but I the test is failing with the following error:</div><div><br></div><div><pre style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: rgb(0, 0, 0); font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); ">Mondrian Error:Internal error: no table 'store_management' found in hierarchy [Store Managers.Manager]</pre><div><br></div></div><div>Which seems to be failing in HierarchyUsage.findJoinTable() (specifically the exception thrown at line 429). &nbsp;Are inline tables not able to be used this way?</div><div><br></div><div>I have defined the cube I am adding with TestContext.create() as follows:</div><div><br></div><div><div>&lt;Cube name="ClosureTest"&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;InlineTable alias="store_management"&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;ColumnDefs&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;ColumnDef name="store_id" type="Numeric"/&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;ColumnDef name="employee_id" type="Numeric"/&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;ColumnDef name="supervisor_id" type="Numeric"/&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;ColumnDef name="manager_rank" type="Numeric"/&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;/ColumnDefs&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;Rows&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;Row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="store_id"&gt;2&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="employee_id"&gt;29&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="supervisor_id"&gt;22&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="manager_rank"&gt;1&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;/Row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;Row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="store_id"&gt;3&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="employee_id"&gt;30&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="supervisor_id"&gt;22&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="manager_rank"&gt;2&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;/Row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;Row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="store_id"&gt;4&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="employee_id"&gt;15&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="supervisor_id"&gt;5&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="manager_rank"&gt;3&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;/Row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;Row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="store_id"&gt;5&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="employee_id"&gt;12&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="supervisor_id"&gt;5&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;Value column="manager_rank"&gt;4&lt;/Value&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;/Row&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;/Rows&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;/InlineTable&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div>&nbsp;&lt;Dimension name="Store Managers" foreignKey="store_id"&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;Hierarchy hasAll="true" allMemberName="All Managers"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;primaryKey="store_id" primaryKeyTable="store_management"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;name="Manager"&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Table name="employee"/&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Level name="Employee Id" type="Numeric" uniqueMembers="true"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;column="employee_id" parentColumn="supervisor_id"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nameColumn="full_name" nullParentValue="0"&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Closure parentColumn="supervisor_id" childColumn="employee_id"&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Table name="employee_closure"/&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/Closure&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/Level&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/Hierarchy&gt;</div><div>&nbsp; &nbsp; &lt;/Dimension&gt;</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &lt;Measure name="Rank" column="manager_rank" aggregator="min" formatString="Standard"/&gt;</div><div>&lt;/Cube&gt;</div></div><div><br></div></div>_______________________________________________<br>Mondrian mailing list<br><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br><a href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br></blockquote></div><br></div></div></div></div>_______________________________________________<br>Mondrian mailing list<br><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br><a href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br></blockquote></div><br></div></div>_______________________________________________<br>Mondrian mailing list<br><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>http://lists.pentaho.org/mailman/listinfo/mondrian<br></blockquote></div><br></div></body></html>