Pentaho Analysis - Mondrian
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-761

mondrian.olap.fun.VisualTotalsFunDef$VisualTotalMember cannot be cast to mondrian.rolap.RolapCubeMember

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Unknown Unknown
    • Resolution: Fixed
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      I got that exception while running some queries from excel pivot:

      Caused by: java.lang.ClassCastException: mondrian.olap.fun.VisualTotalsFunDef$VisualTotalMember cannot be cast to mondrian.rolap.RolapCubeMember
      at mondrian.rolap.RolapCubeMember.compareTo(RolapCubeMember.java:92)


      Test case and fix are attached.
      (test case expects that fix http://jira.pentaho.com/browse/MONDRIAN-682 is also applied)
      1. RolapCubeMember.java
        8 kB
        Sergey Mazin
      2. test_case.txt
        4 kB
        Sergey Mazin
      3. test_case2.txt
        17 kB
        Sergey Mazin

        Activity

        Hide
        Sergey Mazin added a comment -
        test case
        Show
        Sergey Mazin added a comment - test case
        Hide
        Sergey Mazin added a comment -
        test_case.txt is MDX version of the query
        test_case2.txt is XMLA version of the query

        they throw different exceptions.

        test_case.txt is described above

        test_case2.txt throws java.lang.NullPointerException

        the problem is in that part of the query
        "... DIMENSION PROPERTIES PARENT_UNIQUE_NAME, [Store].[Store Name].[Store Type], etc..."

        it can't find property named [Store].[Store Name].[Store Type]

        quick fix is to change getPropertyValue in VisualTotalMember class:

                public Object getPropertyValue(String propertyName, boolean matchCase) {
                    Property property = Property.lookup(propertyName, matchCase);
                    if (property == null) {
                        return null;
                    }
                    switch (property.ordinal) {
                    case Property.CHILDREN_CARDINALITY_ORDINAL:
                        return member.getPropertyValue(propertyName, matchCase);
                    default:
                        return super.getPropertyValue(propertyName, matchCase);
                    }
                }
        Show
        Sergey Mazin added a comment - test_case.txt is MDX version of the query test_case2.txt is XMLA version of the query they throw different exceptions. test_case.txt is described above test_case2.txt throws java.lang.NullPointerException the problem is in that part of the query "... DIMENSION PROPERTIES PARENT_UNIQUE_NAME, [Store].[Store Name].[Store Type], etc..." it can't find property named [Store].[Store Name].[Store Type] quick fix is to change getPropertyValue in VisualTotalMember class:         public Object getPropertyValue(String propertyName, boolean matchCase) {             Property property = Property.lookup(propertyName, matchCase);             if (property == null) {                 return null;             }             switch (property.ordinal) {             case Property.CHILDREN_CARDINALITY_ORDINAL:                 return member.getPropertyValue(propertyName, matchCase);             default:                 return super.getPropertyValue(propertyName, matchCase);             }         }
        Hide
        Julian Hyde added a comment -
        Fixed in change 13711. Will be in mondrian-3.2.1.
        Show
        Julian Hyde added a comment - Fixed in change 13711. Will be in mondrian-3.2.1.

          People

          • Assignee:
            Julian Hyde
            Reporter:
            Sergey Mazin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: