So I ran into a small hurdle with updating the OracleDialect.  The proper syntax in oracle is something like<div><br></div><div><div>ORDER BY &quot;time_by_day&quot;.&quot;the_year&quot; DESC NULLS LAST </div><div><br></div>
<div>The .forceNullsCollateLast() is called independently of placing the ASC or DESC.  Placing ASC/DESC in the statement needs to happen before the call to forceNullsCollateLast(), however, to work properly with Oracle (although not with MySQL).</div>
<div><br></div><div>I see a couple options:</div><div>1)  modify the definition of forceNullsCollateLast() to take a parameter to specify ascending or descending.</div><div>2)  require that the expression, including the ASC or DESC, be passed to forceNullsCollateLast().  The Oracle dialect can then make sure the NULLS LAST happens after the ASC/DESC.</div>
<div><br></div><div>Any preference?</div><div><br></div><div><br><div class="gmail_quote">On Wed, Mar 18, 2009 at 9:29 AM, Matt Campbell <span dir="ltr">&lt;<a href="mailto:mkambol@gmail.com">mkambol@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">testNullCollation fails for a similar reason.  It was formerly not invoking native top count, since the redundant curly braces (&quot;{[Store].[Store Name].members}&quot;) were causing it to fail native evaluation checks.  Now that it does invoke native evaluation it exposes a bug in the Oracle dialect.  The native query orders by both the [Store Name] ordinal and [store sqft], but omits the NULLS LAST expression.  Oracle requires the NULLS LAST expression for proper collation, which is not captured in the dialect.  I&#39;ll look into making this change. <div>

<div><br></div><div>On another note, I&#39;m not sure that testNullCollation was ever testing what it was intended to.  It appears to be testing the the ordering of members with NULL ordinals correctly puts them at the end.  The [HQ] member in the test is set to have a null ordinal.  The query used in the test, however, uses a topcount function, and HQ does not fall into the topcount set.  So this would never actually validate that HQ was placed at the end.<div>
<div></div><div class="h5"><br>
<div><br></div><div><br></div><div><br><div class="gmail_quote">On Wed, Mar 18, 2009 at 7:39 AM, Matt Campbell <span dir="ltr">&lt;<a href="mailto:mkambol@gmail.com" target="_blank">mkambol@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I had posted about the failed testTopCount last week and never heard a response.  I think we should probably disable that test until high cardinality functionality is fixed with top count (it currently only works if native top count fails).  Here&#39;s the background:<div>


----</div><div><span style="border-collapse:collapse;color:rgb(34, 34, 34)">The test appears to be intended to show that the HighCardinality code will return the correct number of tuples when a TopCount function is used.  In the definition of TopBottomCountFunDef, however, if a nativeEvaluator is found, the expression will be evaluated with ResultStyle.LIST--which causes it to use SqlTupleReader, rather than the HighCardSqlTupleReader.  So if native top count actually is used, then the high cardinality code is not executed.  <div>


<br></div><div>This test formerly passed because it the queries it uses have redundant set braces, which caused native evaluation to fail.  Running the same query without the redundant set braces would have caused a test failure prior to my change yesterday.</div>


<div><br></div><div>Another problem appears to be that the ResultLimit property has two different purposes in SqlTupleReader and HighCardSqlTupleReader.  In SqlTupleReader if the results fetched exceeds the limit than an exception will be thrown.  With HighCardSqlTupleReader, it seems to be used to set the size of the internal LinkedList used for holding tuples, but will not throw an exception.  Note that the Target class is the one that maintains this LinkedList, it&#39;s used by HighCardSqlTupleReader.</div>


<div><br></div><div>I&#39;m looking for suggestions on the best way to address this.  It seems like there probably should be a separate property for the HighCard version of result limit.  It also seems like if it is intended to work with TopCount, then it shouldn&#39;t be dependent on native evaluation failing.  The test only accidentally passed before, since the set braces should be unnecessary.</div>


</span><br><div class="gmail_quote">2009/3/18 Julian Hyde <span dir="ltr">&lt;<a href="mailto:jhyde@pentaho.com" target="_blank">jhyde@pentaho.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div></div><div>




<div>
<div dir="ltr" align="left"><span><font face="Lucida Sans" color="#000080" size="2">Change 12424 also broke 
HighCardinalityTest.testTopCount:</font></span></div>
<div dir="ltr" align="left"><span><span lang="EN">
<p>[java] 1) 
testTopCount(mondrian.rolap.HighDimensionsTest)mondrian.olap.ResourceLimitExceededException: 
Mondrian Error:Number of members to be read exceeded limit (40)</p>
<p>[java] at 
mondrian.resource.MondrianResource$_Def10.ex(MondrianResource.java:991)</p>
<p>[java] at 
mondrian.rolap.SqlTupleReader.prepareTuples(SqlTupleReader.java:428)</p>
<p>[java] at 
mondrian.rolap.SqlTupleReader.readMembers(SqlTupleReader.java:498)</p>
<p>[java] at 
mondrian.rolap.RolapNativeSet$SetEvaluator.executeList(RolapNativeSet.java:202)</p>
<p>[java] at 
mondrian.rolap.RolapNativeSet$SetEvaluator.execute(RolapNativeSet.java:157)</p>
<p>[java] at 
mondrian.olap.fun.TopBottomCountFunDef$3.evaluateList(TopBottomCountFunDef.java:83)</p>
<p>[java] at 
mondrian.calc.impl.AbstractListCalc.evaluateMemberList(AbstractListCalc.java:92)</p>
<p>[java] at 
mondrian.calc.impl.AbstractExpCompiler$MemberListIterCalc.evaluateMemberIterable(AbstractExpCompiler.java:544)</p>
<p>[java] at 
mondrian.calc.impl.AbstractMemberIterCalc.evaluate(AbstractMemberIterCalc.java:55)</p>
<p>[java] at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:727)</p>
<p>[java] at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:578)</p>
<p>[java] at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:553)</p>
<p>[java] at mondrian.rolap.RolapResult.&lt;init&gt;(RolapResult.java:269)</p>
<p>[java] at 
mondrian.rolap.RolapConnection.execute(RolapConnection.java:560)</p>
<p>[java] at 
mondrian.rolap.HighDimensionsTest.execHighCardTest(HighDimensionsTest.java:197)</p>
<p>[java] at 
mondrian.rolap.HighDimensionsTest.testTopCount(HighDimensionsTest.java:124)</p><div>
<p>[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p>
<p>[java] at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p>
<p>[java] at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p>
<p>[java] at 
mondrian.test.MondrianTestRunner$2.run(MondrianTestRunner.java:129)</p>
<p>[java] at java.lang.Thread.run(Thread.java:619)</p></div></span></span></div><br>
<blockquote dir="ltr" style="padding-left:5px;margin-left:5px;border-left:#000080 2px solid;margin-right:0px">
  <div lang="en-us" dir="ltr" align="left">
  <hr>
  <font face="Tahoma" size="2"><b>From:</b> Julian Hyde [mailto:<a href="mailto:jhyde@pentaho.com" target="_blank">jhyde@pentaho.com</a>] 
  <b>On Behalf Of </b>Julian Hyde<br><b>Sent:</b> Tuesday, March 17, 2009 2:12 
  PM<br><b>To:</b> &#39;Matt Campbell&#39;<br><b>Cc:</b> &#39;Mondrian developer mailing 
  list&#39;<br><b>Subject:</b> Change 12424<br></font><br></div><div><div></div><div>
  <div></div>
  <div><span><font face="Lucida Sans" color="#000080" size="2">Matt,</font></span></div>
  <div><span><font face="Lucida Sans" color="#000080" size="2"></font></span> </div>
  <div><span><font face="Lucida Sans" color="#000080" size="2">Change 12424 broke CompatibilityTest.testNullCollation on Oracle. Can 
  you take a look please.</font></span></div>
  <div><span><font face="Lucida Sans" color="#000080" size="2"></font></span> </div>
  <div><span><span lang="EN">
  <p>[java] [0] .............F...</p>
  <p>[java] There was 1 failure:</p>
  <p>[java] 1) 
  testNullCollation(mondrian.test.CompatibilityTest)junit.framework.ComparisonFailure: 
  Expected:</p>
  <p>[java] Axis #0:</p>
  <p>[java] {}</p>
  <p>[java] Axis #1:</p>
  <p>[java] {[Measures].[Store Sqft]}</p>
  <p>[java] Axis #2:</p>
  <p>[java] {[Store].[All Stores].[Store 3]}</p>
  <p>[java] {[Store].[All Stores].[Store 18]}</p>
  <p>[java] {[Store].[All Stores].[Store 9]}</p>
  <p>[java] {[Store].[All Stores].[Store 10]}</p>
  <p>[java] {[Store].[All Stores].[Store 20]}</p>
  <p>[java] Row #0: 39,696</p>
  <p>[java] Row #1: 38,382</p>
  <p>[java] Row #2: 36,509</p>
  <p>[java] Row #3: 34,791</p>
  <p>[java] Row #4: 34,452</p>
  <p>[java] </p>
  <p>[java] Actual:</p>
  <p>[java] Axis #0:</p>
  <p>[java] {}</p>
  <p>[java] Axis #1:</p>
  <p>[java] {[Measures].[Store Sqft]}</p>
  <p>[java] Axis #2:</p>
  <p>[java] </p>
  <p>[java] Actual java:</p>
  <p>[java] fold(</p>
  <p>[java] &quot;Axis #0:\n&quot; +</p>
  <p>[java] &quot;{}\n&quot; +</p>
  <p>[java] &quot;Axis #1:\n&quot; +</p>
  <p>[java] &quot;{[Measures].[Store Sqft]}\n&quot; +</p>
  <p>[java] &quot;Axis #2:\n&quot;)</p>
  <p>[java] expected:&lt;...ore Sqft]}</p>
  <p>[java] Axis #2:</p>
  <p>[java] [{[Store].[All Stores].[Store 3]}</p>
  <p>[java] {[Store].[All Stores].[Store 18]}</p>
  <p>[java] {[Store].[All Stores].[Store 9]}</p>
  <p>[java] {[Store].[All Stores].[Store 10]}</p>
  <p>[java] {[Store].[All Stores].[Store 20]}</p>
  <p>[java] Row #0: 39,696</p>
  <p>[java] Row #1: 38,382</p>
  <p>[java] Row #2: 36,509</p>
  <p>[java] Row #3: 34,791</p>
  <p>[java] Row #4: 34,452</p>
  <p>[java] ]&gt; but was:&lt;...ore Sqft]}</p>
  <p>[java] Axis #2:</p>
  <p>[java] []&gt;</p>
  <p>[java] at 
  mondrian.test.TestContext.assertEqualsVerbose(TestContext.java:881)</p>
  <p>[java] at 
  mondrian.test.TestContext.assertEqualsVerbose(TestContext.java:849)</p>
  <p>[java] at 
  mondrian.test.TestContext.assertQueryReturns(TestContext.java:818)</p>
  <p>[java] at 
  mondrian.test.CompatibilityTest.testNullCollation(CompatibilityTest.java:381)</p>
  <p>[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p>
  <p>[java] at 
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p>
  <p>[java] at 
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p>
  <p>[java] at 
  mondrian.test.MondrianTestRunner$2.run(MondrianTestRunner.java:129)</p>
  <p>[java] at java.lang.Thread.run(Thread.java:619)</p>
  <p> </p>
  <p><font face="Lucida Sans" color="#000080" size="2"></font> </p>
  <p><span><font face="Lucida Sans" color="#000080" size="2">Julian</font></span></p></span></span></div></div></div></blockquote></div>
<br></div></div>_______________________________________________<br>
Mondrian mailing list<br>
<a href="mailto:Mondrian@pentaho.org" target="_blank">Mondrian@pentaho.org</a><br>
<a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div></div>