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

Olap4j's method toOlap4j throws NPE if we have a function

    Details

    • Type: Bug
    • Status: Open
    • Severity: High
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:
      None
    • 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.

      Description

      In MondrianOlap4jConnection, method toOlap4j, we have:

      } else if (type instanceof mondrian.olap.type.MemberType)

      { final mondrian.olap.type.MemberType memberType = (mondrian.olap.type.MemberType) type; return new MemberType( toOlap4j(memberType.getDimension()), toOlap4j(memberType.getHierarchy()), toOlap4j(memberType.getLevel()), toOlap4j(memberType.getMember())); }

      if that memberType is given by a calc which is a function, getDimension returns null, giving a NPE in the end.

      This query on foodmart triggers it:

      SELECT
      NON EMPTY {Hierarchize(

      {[Measures].[Customer Count]}

      )} ON COLUMNS,
      CurrentDateMember([Time], """[Time].[Year].[1997]""")
      ON ROWS
      FROM [Sales 2]

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pmalves Pedro Alves
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: