Uploaded image for project: 'Pentaho Analysis - Mondrian'
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-1170

Improve API for parent-child hierarchies



    • Type: New Feature
    • Status: Open
    • Severity: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.


      Improve API for parent-child hierarchies, in particular make it easier & more efficient to find out whether a member is a leaf member.

      Mondrian legacy has API Member.isParentChildLeaf (although implementation is inefficient); olap4j API does not have an equivalent. Nearest equivalent in olap4j is Member.getChildMemberCount() (inefficient, because it retrieves and counts all children).

      Idea #1. Add distance-from-root and distance-from-leaf columns to closure table. (Columns would be optional. Mondrian would use them if present, but would not complain if absent.)

      Idea #2. Evaluate the boolean expression "member.measure = member.datamember.measure". With the right choice of measure, this will only evaluate true if the member is a leaf. It is supported by the cell cache, so there would not be one SQL query for each member.

      Idea #3. Populate hierarchy using recursive SQL (ANSI "with recursive", similar to Oracle's "connect by").

      Idea #4. In XMLA MDSCHEMA_MEMBERS, CHILDREN_CARDINALITY is defined as "The number of children that the member has. This can be an estimate, so consumers should not rely on this to be the exact count. Providers should return the best estimate possible." Mondrian could guarantee that this is zero if and only if there are zero children. And propagate the guarantee to getChildMemberCount().




            Unassigned Unassigned
            jhyde Julian Hyde (Inactive)
            0 Vote for this issue
            1 Start watching this issue