[Mondrian] RE: Mr. Hyde
Julian Hyde
julianhyde at speakeasy.net
Wed Jun 6 22:28:14 EDT 2007
I would use a debugger
> -----Original Message-----
> From: Javier Giménez Aznar [mailto:javier.gimenez at stratebi.com]
> Sent: Monday, June 04, 2007 5:34 AM
> To: mondrian at pentaho.org
> Cc: 'Julian Hyde'; 'Luis F. Canals'
> Subject: RV: Mr. Hyde
>
> Hello Julian and everybody on the list,
>
> We are trying to change mondrian code so it is able to manage
> Internal Codes
> of members when referencing them with the "column" instead of with the
> "nameColumn". Making possible for example using [2007].&[2] instead of
> [2007].[February] to reference the member.
>
> The problem seems to be around that ampersand &.
>
> I seems that when parsing the MDX query, mondrian converts string like
> "[xxx].[yyyy].[zzzz]..." in arrays of strings like "[xxx]",
> "[yyy]", "[zzz]" and then back to a single string.
>
> This happens in the clase Util. When changing the methods
>
> lookup(..String[]..)
> for
> lookup(..Id.Segment[]..)
>
> we have to change every class that uses them and we observe this weird
> behaviour that seems to cost time.
>
> Our questions are.
> a) Wouldn't it be better to use Id.Segment instead of an
> array of strings
> like "[xxx],[yyy]"?
You are absolutely on the right track. We should use Id.Segment in as
many places as possible.
> b) Where could the conversion of the MDX text to Is.Segment
> be made? (we
> suspect watching the logs that in mondrian.olap.parser the
> mondrian.olap.query object is created with well identified
> Id.segments, but
> somewhere before mondrian.olap.Util.lookup they are lost and
> converted to
> String, so this seems to be already donde somewhere)
I would use a debugger, and put a breakpoint in Util.lookup. At some
point in the stack, the one data structure will turn into the other.
> And a more general question. Are we on the right path?
Yes, I think that not using Id.Segment is the root cause of the problem.
Before you start implementing a fix, I suggest that you add a test case
to ParserTest which will fail until you have correctly implemented a
solution.
Julian
More information about the Mondrian
mailing list