[Mondrian] mondrianolap4jmember getAncestorMembers

Julian Hyde jhyde at pentaho.com
Fri May 28 21:03:07 EDT 2010

I've implemented this method in mondrian's olap4j driver; change 13650.
I also added a test to olap4j.


From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On
Behalf Of Paul Stoellberger
Sent: Thursday, May 27, 2010 7:47 AM
To: mondrian at pentaho.org
Subject: [Mondrian] mondrianolap4jmember getAncestorMembers


I have implemented in PAT a routine that checks if one member is an ancestor
of the another member.
For that reason I use Member member.getAncestorMembers() , which works
perfectly fine on an XMLA connection, since an XmlaOlap4jMember implements
that method, but the MondrianOlap4jMember does not and throws an
UnsupportedOperationException instead.

Is there any good reason why this is not implemented? I know I could ?do? it
myself by browsing through the getParentMember() myself but I thought using
the getAncestorMembers() is fine as well.

So in MondrianOlap4jMember the implementation would look like:

public List<Member> getAncestorMembers() { final List<Member> list = new
       MondrianOlap4jMember m = getParentMember();
       while (m != null) {
           m = m.getParentMember();
       return list;

I know using the getAncestorMembers() function would be expensive on
dimensions with a large hierarchy.
Do you think it would be more reasonable to loop through getParentMember
myself until I find it?

Nevertheless an implementation of getAncestorMembers() would make sense from
my pov, unless you have a good reason why its not implemented yet. If I use
olap4j, I don?t want to care if I use xmla or Mondrian connections and just
use the same set of methods.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20100528/3d9a8f83/attachment.html 

More information about the Mondrian mailing list