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

Level of calculated member is different when hierarchy is access-controlled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.2.0 GA (3.6.0 GA Suite Release)
    • 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.
    • QA Validation Status:
      Not Yet Validated

      Description

      Use the TopLevel.xml schema referenced in Mondrian-742 and try to build the following report:

      1. Use HR Cube
      2. Add Store State
      3. Add Store City
      4. Add Count
      5. Right click Store State and select Show Subtotals.

      BUG: You will get below stack trace.

      java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException
      at com.pentaho.analyzer.report.ReportRequestService.get(ReportRequestService.java:199)
      at com.pentaho.analyzer.content.controller.ReportRunner.getResult(ReportRunner.java:222)
      at com.pentaho.analyzer.content.controller.AjaxBean.getReportHTML(AjaxBean.java:190)
      at com.pentaho.analyzer.content.AnalyzerContentGenerator.createContent(AnalyzerContentGenerator.java:168)
      at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.pentaho.platform.web.http.context.WebSpringPentahoObjectFactory$ProxyInvokeHandler.invoke(WebSpringPentahoObjectFactory.java:220)
      at $Proxy96.createContent(Unknown Source)
      at org.pentaho.platform.web.servlet.GenericServlet.doGet(GenericServlet.java:258)
      at org.pentaho.platform.web.servlet.GenericServlet.doPost(GenericServlet.java:79)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
      at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
      at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.pentaho.platform.web.http.security.RequestParameterAuthenticationFilter.doFilter(RequestParameterAuthenticationFilter.java:169)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174)
      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278)
      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.pentaho.platform.web.http.security.HttpSessionReuseDetectionFilter.doFilter(HttpSessionReuseDetectionFilter.java:134)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.pentaho.platform.web.http.filters.HttpSessionPentahoSessionIntegrationFilter.doFilter(HttpSessionPentahoSessionIntegrationFilter.java:264)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
      at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
      at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
      at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.pentaho.ui.servlet.SystemStatusFilter.doFilter(SystemStatusFilter.java:43)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.pentaho.platform.web.http.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:113)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException
      at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
      at java.util.concurrent.FutureTask.get(FutureTask.java:91)
      at com.pentaho.analyzer.report.ReportRequestService.get(ReportRequestService.java:157)
      ... 66 more
      Caused by: java.lang.IllegalStateException
      at com.pentaho.analyzer.report.mdx.MDXParseUtil.getParentMember(MDXParseUtil.java:47)
      at com.pentaho.analyzer.report.OutputPositionBuilder.makeSubtotalKey(OutputPositionBuilder.java:394)
      at com.pentaho.analyzer.report.OutputPositionBuilder.processSubtotalPositions(OutputPositionBuilder.java:254)
      at com.pentaho.analyzer.report.OutputPositionBuilder.processPositions(OutputPositionBuilder.java:226)
      at com.pentaho.analyzer.report.ReportManagerImpl.processQueryResults(ReportManagerImpl.java:542)
      at com.pentaho.analyzer.report.ReportManagerImpl.runReport(ReportManagerImpl.java:121)
      at com.pentaho.analyzer.report.ReportManagerImpl.runReport(ReportManagerImpl.java:87)
      at com.pentaho.analyzer.report.ReportRequestService$2.call(ReportRequestService.java:250)
      at com.pentaho.analyzer.report.ReportRequestService$2.call(ReportRequestService.java:1)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      ... 1 more
      1. foodmart.mondrian.xml
        39 kB
        Benny Chow
      1. Screenshot-1.png
        87 kB

        Issue Links

          Activity

          Hide
          Benny Chow added a comment -
          This seems to be a regression in Mondrian. Run this query using the attached Foodmart schema:

          With
          Set [*NATIVE_CJ_SET] as 'Filter([*BASE_MEMBERS_Customers], Not IsEmpty ([Measures].[Sales Count]))'
          Set [*SORTED_ROW_AXIS] as 'Order([*CJ_ROW_AXIS],Ancestor([Customers].CurrentMember, [Customers].[State Province]).OrderKey,BASC,Ancestor([Customers].CurrentMember,[Customers].[Country]).OrderKey,BASC,[Customers].CurrentMember.OrderKey,BASC)'
          Set [*BASE_MEMBERS_Customers] as '{[Customers].[USA].[CA].[Altadena]}'
          Set [*NATIVE_MEMBERS_Customers] as 'Generate([*NATIVE_CJ_SET], {[Customers].CurrentMember})'
          Set [*BASE_MEMBERS_Measures] as '{[Measures].[*FORMATTED_MEASURE_0]}'
          Set [*CJ_ROW_AXIS] as 'Generate([*NATIVE_CJ_SET], {([Customers].currentMember)})'
          Set [*CJ_COL_AXIS] as '[*NATIVE_CJ_SET]'
          Member [Customers].[USA].[CA].[*TOTAL_MEMBER_SEL~SUM] as 'Sum(Filter([*NATIVE_MEMBERS_Customers],Ancestor([Customers].CurrentMember, [Customers].[State Province]) IS [Customers].[USA].[CA]))', SOLVE_ORDER=-100
          Member [Measures].[*FORMATTED_MEASURE_0] as '[Measures].[Sales Count]', FORMAT_STRING = '#,###', SOLVE_ORDER=400
          Select
          [*BASE_MEMBERS_Measures] on columns,
          Union({[Customers].[USA].[CA].[*TOTAL_MEMBER_SEL~SUM]},[*SORTED_ROW_AXIS]) on rows
          From [Sales]

          In Schema WB, this will return which is the correct result.

          Axis #0:
          {}
          Axis #1:
          {[Measures].[*FORMATTED_MEASURE_0]}
          Axis #2:
          {[Customers].[USA].[CA].[*TOTAL_MEMBER_SEL~SUM]}
          {[Customers].[USA].[CA].[Altadena]}
          Row #0: 841
          Row #1: 841

          However, if you look at the level for the "[Customers].[USA].[CA].[*TOTAL_MEMBER_SEL~SUM]" member, this is reported as [Customers].[State Province] instead of [Customers].[City] in the Eclipse debugger (see screenshot). This causes problems in Analyzer when it checks a level of a member and Mondrian returns the wrong level. I tested the same query on a hierarchy which is not access controlled and Mondrian will return the correct level for a similar calculated member.

          Show
          Benny Chow added a comment - This seems to be a regression in Mondrian. Run this query using the attached Foodmart schema: With Set [*NATIVE_CJ_SET] as 'Filter([*BASE_MEMBERS_Customers], Not IsEmpty ([Measures].[Sales Count]))' Set [*SORTED_ROW_AXIS] as 'Order([*CJ_ROW_AXIS],Ancestor([Customers].CurrentMember, [Customers].[State Province]).OrderKey,BASC,Ancestor([Customers].CurrentMember,[Customers].[Country]).OrderKey,BASC,[Customers].CurrentMember.OrderKey,BASC)' Set [*BASE_MEMBERS_Customers] as '{[Customers].[USA].[CA].[Altadena]}' Set [*NATIVE_MEMBERS_Customers] as 'Generate([*NATIVE_CJ_SET], {[Customers].CurrentMember})' Set [*BASE_MEMBERS_Measures] as '{[Measures].[*FORMATTED_MEASURE_0]}' Set [*CJ_ROW_AXIS] as 'Generate([*NATIVE_CJ_SET], {([Customers].currentMember)})' Set [*CJ_COL_AXIS] as '[*NATIVE_CJ_SET]' Member [Customers].[USA].[CA].[*TOTAL_MEMBER_SEL~SUM] as 'Sum(Filter([*NATIVE_MEMBERS_Customers],Ancestor([Customers].CurrentMember, [Customers].[State Province]) IS [Customers].[USA].[CA]))', SOLVE_ORDER=-100 Member [Measures].[*FORMATTED_MEASURE_0] as '[Measures].[Sales Count]', FORMAT_STRING = '#,###', SOLVE_ORDER=400 Select [*BASE_MEMBERS_Measures] on columns, Union({[Customers].[USA].[CA].[*TOTAL_MEMBER_SEL~SUM]},[*SORTED_ROW_AXIS]) on rows From [Sales] In Schema WB, this will return which is the correct result. Axis #0: {} Axis #1: {[Measures].[*FORMATTED_MEASURE_0]} Axis #2: {[Customers].[USA].[CA].[*TOTAL_MEMBER_SEL~SUM]} {[Customers].[USA].[CA].[Altadena]} Row #0: 841 Row #1: 841 However, if you look at the level for the "[Customers].[USA].[CA].[*TOTAL_MEMBER_SEL~SUM]" member, this is reported as [Customers].[State Province] instead of [Customers].[City] in the Eclipse debugger (see screenshot). This causes problems in Analyzer when it checks a level of a member and Mondrian returns the wrong level. I tested the same query on a hierarchy which is not access controlled and Mondrian will return the correct level for a similar calculated member.
          Hide
          Julian Hyde added a comment -
          Fixed in change 13650.
          Show
          Julian Hyde added a comment - Fixed in change 13650.
          Hide
          Benny Chow added a comment -
          Verified in Analyzer.
          Show
          Benny Chow added a comment - Verified in Analyzer.

            People

            • Assignee:
              Golda David
              Reporter:
              Benny Chow
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: