<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18813"></HEAD>
<BODY
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV><SPAN class=506504405-04082009><FONT color=#000080 size=2
face="Lucida Sans">By coincidence, I had remembered that you had received a
ClassCastException, and there was something to do with a calculated set, and I
was investigating as you filed the bug.</FONT></SPAN></DIV>
<DIV><SPAN class=506504405-04082009><FONT color=#000080 size=2
face="Lucida Sans"></FONT></SPAN> </DIV>
<DIV><SPAN class=506504405-04082009><FONT color=#000080 size=2
face="Lucida Sans">Mondrian implements MDX sets as both java.util.List and
java.util.Iterable internally. It is not safe for the author of a UDF to assume
that if the argument is an MDX set then Argument.evaluate will return a List, as
you did in your Reverse UDF. I added new methods Argument.evaluateList and
Argument.evaluateIter. The author of the UDF must call one of
these.</FONT></SPAN></DIV>
<DIV><SPAN class=506504405-04082009><FONT color=#000080 size=2
face="Lucida Sans"></FONT></SPAN> </DIV>
<DIV><SPAN class=506504405-04082009><FONT color=#000080 size=2
face="Lucida Sans">See further comments in the bug: <A
href="http://jira.pentaho.com/browse/MONDRIAN-589"><FONT size=3
face="Times New Roman">http://jira.pentaho.com/browse/MONDRIAN-589</FONT></A></FONT></SPAN></DIV>
<DIV><SPAN class=506504405-04082009><FONT color=#000080 size=2
face="Lucida Sans"></FONT></SPAN> </DIV>
<DIV><SPAN class=506504405-04082009><FONT color=#000080 size=2
face="Lucida Sans">Note that this is fixed on the 3.1
branch.</FONT></SPAN></DIV>
<DIV><SPAN class=506504405-04082009></SPAN> </DIV>
<DIV><SPAN class=506504405-04082009><FONT color=#000080 size=2
face="Lucida Sans">Julian</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #000080 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Eric McDermid
[mailto:mcdermid@stonecreek.com] <BR><B>Sent:</B> Monday, August 03, 2009 8:31
PM<BR><B>To:</B> jhyde@pentaho.com<BR><B>Cc:</B> Mondrian developer mailing
list<BR><B>Subject:</B> Re: [Mondrian] Problem moving UDF returning a list
from 2.4 to 3.1.1<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Thanks for the fix, Julian.</DIV>
<DIV><BR></DIV>
<DIV>Running the new code, I do find that i still run into the second issue I
mentioned below (args[0] evaluating anonymous Iterable rather than a List).
Near as I can tell, the problem only occurs
when passing a named set to the UDF.</DIV>
<DIV><BR></DIV>
<DIV>I've created a simple reproduction case that demonstrates the problem,
and created MONDRIAN-589 to track it.</DIV>
<DIV><BR></DIV>
<DIV> -- Eric<BR>
<DIV><BR>
<DIV>
<DIV>On Jul 31, 2009, at 9:10 PM, Eric McDermid 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">Done.
Mondrian-588.
<DIV><BR></DIV>
<DIV>I've also added some further notes in that description. I
experimented this afternoon with changing UdfResolver to return an object
that implements AbstractMemberListCalc (rather than just GenericCalc) if the
compiler's preferred result type is a list. I'm not sure it's the
right answer, and I've yet to run the full test suite on it, but it does get
me past the error. </DIV>
<DIV><BR></DIV>
<DIV>Unfortunately, when the Reverse UDF is actually executed,
"args[0].evaluate(eval)" returns an anonymous Iterable generated from
RolapNamedSetEvaluator.evaluateMemberIterable(), rather than a List as used
to be the case under 2.4, triggering a class cast exception. This has
nothing to do with my workaround; I've seen it prior to the change as
well.</DIV>
<DIV><BR></DIV>
<DIV> -- Eric</DIV>
<DIV><BR>
<DIV>
<DIV>On Jul 31, 2009, at 7:33 PM, Julian Hyde 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">
<DIV><SPAN class=479463201-01082009><FONT color=#000080 size=2
face="Lucida Sans">I'll look into it over the weekend. Can you please log
a bug.</FONT></SPAN></DIV>
<DIV><SPAN class=479463201-01082009><FONT color=#000080 size=2
face="Lucida Sans"></FONT></SPAN> </DIV>
<DIV><SPAN class=479463201-01082009><FONT color=#000080 size=2
face="Lucida Sans">Julian</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #000080 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> <A
href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</A>
[<A
href="mailto:mondrian-bounces@pentaho.org">mailto:mondrian-bounces@pentaho.org</A>]
<B>On Behalf Of </B>Eric McDermid<BR><B>Sent:</B> Friday, July 31, 2009
10:36 AM<BR><B>To:</B> Mondrian developer mailing
list<BR><B>Subject:</B> [Mondrian] Problem moving UDF returning a list
from 2.4 to 3.1.1<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>I'm having some trouble with a UDF returning a List that worked
under 2.4, but fails with a parse error under 3.1.1. I'm not sure
whether the problem is a flaw in the UDF or in how the newer version of
Mondrian is attempting to use it. </DIV>
<DIV><BR></DIV>
<DIV>Here's the function, which simply reverses the order of a
set:</DIV>
<DIV>
<DIV><BR></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span> public class ReverseFunction
implements UserDefinedFunction {</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>public
Object execute(Evaluator eval, Argument[] args) {</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>List
memberList = (List) args[0].evaluate(eval);</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span>Collections.reverse(memberList);</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>return
memberList;</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span>}</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>public
String getDescription() {</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>return
"Reverses the order of a set";</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span>}</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>public
String getName() {</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>return
"Reverse";</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span>}</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>public
Type[] getParameterTypes() {</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>return new
Type[] {new SetType(MemberType.Unknown)};</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span>}</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>public
String[] getReservedWords() {</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>return
null;</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span>}</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>public Type
getReturnType(Type[] arg0) {</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>return
arg0[0];</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span>}</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>public
Syntax getSyntax() {</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>return
Syntax.Function;</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span>}</SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span> }</SPAN></FONT></DIV>
<DIV><BR></DIV>
<DIV>
<DIV>The stack trace for the underlying cause of the error is
here:</DIV>
<DIV><BR></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span>Caused by: mondrian.olap.MondrianException:
Mondrian Error:Internal error: Cannot convert calc to list:
mondrian.olap.fun.UdfResolver$CalcImpl@315d04</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:803)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.Util.newInternal(Util.java:1465)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.calc.impl.AbstractExpCompiler.compileList(AbstractExpCompiler.java:286)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.calc.impl.BetterExpCompiler.compileList(BetterExpCompiler.java:77)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.calc.impl.AbstractExpCompiler.compileList(AbstractExpCompiler.java:260)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.fun.SetFunDef$MemberSetListCalc.createCalc(SetFunDef.java:147)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.fun.SetFunDef$MemberSetListCalc.compileSelf(SetFunDef.java:134)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.fun.SetFunDef$MemberSetListCalc.<init>(SetFunDef.java:120)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.fun.SetFunDef.compileCall(SetFunDef.java:89)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.mdx.ResolvedFunCall.accept(ResolvedFunCall.java:152)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.calc.impl.AbstractExpCompiler.compile(AbstractExpCompiler.java:79)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.calc.impl.AbstractExpCompiler.compileAs(AbstractExpCompiler.java:124)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.calc.impl.AbstractExpCompiler.compileIter(AbstractExpCompiler.java:311)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.QueryAxis.compile(QueryAxis.java:122)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.Query.compile(Query.java:519)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.Query.resolve(Query.java:456)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.Query.<init>(Query.java:231)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.Query.<init>(Query.java:187)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.Parser.makeQuery(Parser.java:870)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.CUP$Parser$actions.CUP$Parser$do_action(Parser.java:1764)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.Parser.do_action(Parser.java:699)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
java_cup.runtime.lr_parser.parse(lr_parser.java:569)</SPAN></FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT
class=Apple-style-span size=3><SPAN style="FONT-SIZE: 11px"
class=Apple-style-span></SPAN></FONT></SPAN><FONT class=Apple-style-span
size=3><SPAN style="FONT-SIZE: 11px" class=Apple-style-span>at
mondrian.olap.Parser.parseInternal(Parser.java:772)</SPAN></FONT></DIV>
<DIV><BR></DIV>
<DIV>The immediate problem is in AbstractExpCompiler.compileList().
It compiles the expression "Reverse([Requested Dates])", gets a
mondrian.olap.fun.UdfResolver$CalcImpl instance as a result, then
complains because said calc is neither null, a ListCalc, or an
IterCalc.</DIV>
<DIV><BR></DIV>
<DIV>UDF documentation seems a little thin, and I've been unable to find
an example of a UDF returning a list in either mondrian/udf or in
UdfTest to use as a reference point. Searching the archive, I
do see that Pappyn Bart asked a somewhat similar question back in 2007,
but I didn't see a clear resolution.</DIV>
<DIV><BR></DIV>
<DIV>Can anyone help me sort this problem out, or failing that at least
point me to an example of a UDF that does successfully return a list
that I can compare against?</DIV>
<DIV><BR></DIV>
<DIV> -- Eric</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></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></DIV></BLOCKQUOTE></BODY></HTML>