[Mondrian] Custom MemberReader?

Andreas_Voss at tonbeller.com Andreas_Voss at tonbeller.com
Tue Apr 7 14:56:14 EDT 2009

Hi all,

I need to implement (and hopefully contribute) a custom MemberReader that 
generates a time dimension using a calendar. The customer wants to see all 
dates even if they do not appear in the database. The generated time 
members must behave as if they came from the database, for example, if 
such a generated member is in the slicer, its key must be part of the SQL 
where-clause when the cells (Segments) are loaded.

So I sat the attribute memberReaderClass of the hierarchy in the schema 
and wrote a class that implements MemberSource. But my class was not 
instantiated, instead I got a NPE in RolapHierarchy.getUniqueTable() where 
the relation member is null. I have not yet found the reason for this.

When browsing through the code I found another weird thing. The class 
RolapCubeSqlMemberSource extends SqlMemberSource and is instantiated 
directly from (No)CacheRolapCubeHierarchyMemberReader in 
RolapCubeHierarchy, without checking if a custom MemberReader exists. This 
code seems to be quite new (not in version 2.2.x). I dont think I 
understand how/why everything (RolapMember, RolapHierarchy etc) gets 
wrapped by a corresponding RolapCubeXyz version.

Also probably the native crossjoin code must be examined, if a custom 
member reader is involved then the native code can not be used.

Currently I'm quite lost. Is a custom MemberReader the right way to 
implement the requirement? Or is it a  relict from long ago that won't 
work any more? Are there other glitches in the code that could prevent it 
from function? And I dont understand the RolapCubeXyz wrapping - should 
the MemberSource wrap its members or are they wrapped later? Lots of 
questions ...

An example of a custom MemberReader would be great ;-) 

Thanks for any hints,

Werner-von-Siemens-Str. 2 
D-64625 Bensheim 

Register Court: District Court Darmstadt
Registration: HRB 21474
Managing Board: Rutger Hetzler (CEO), Sebastian Hetzler, Torsten Mayer
Chairman of the Supervisory Board: Rüdiger Brand

This message is for the designated recipient only and may contain privileged,
proprietary, or otherwise private information. If you have received it in error,
please notify the sender immediately and delete the original. Any unauthorised copying or dissemination of this message is strictly prohibited.
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail.
Das unerlaubte Kopieren sowie die Weitergabe dieser E-Mail ist nicht gestattet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20090407/d1012ee6/attachment.html 

More information about the Mondrian mailing list