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

Closure tables - edge case breaks sorting in Java 7

    XMLWordPrintable

    Details

    • 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

      We are running into some sort of edge case that is causing TimSort to break when sorting a parent child dimension that uses a closure table.

      I have not been able to create a simple test case that replicates this issue but I do have a stack trace.

      Caused by: org.olap4j.OlapException: mondrian gave exception while executing query
      	at mondrian.olap4j.MondrianOlap4jConnection$Helper.createException(MondrianOlap4jConnection.java:759)
      	at mondrian.olap4j.MondrianOlap4jStatement.executeOlapQueryInternal(MondrianOlap4jStatement.java:421)
      	at mondrian.olap4j.MondrianOlap4jPreparedStatement.executeQuery(MondrianOlap4jPreparedStatement.java:72)
      	... 7 more
      Caused by: mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while executing query [select {[Measures].[Clicks]} ON COLUMNS,
        Order([Custom Section].[Custom Sections].[Custom Section].Members, [Measures].[Clicks], BDESC) ON ROWS
      from [Sales] 
      ]
      	at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:942)
      	at mondrian.olap.Util.newInternal(Util.java:2411)
      	at mondrian.olap.Util.newError(Util.java:2427)
      	at mondrian.rolap.RolapConnection.executeInternal(RolapConnection.java:712)
      	at mondrian.rolap.RolapConnection.access$000(RolapConnection.java:51)
      	at mondrian.rolap.RolapConnection$1.call(RolapConnection.java:628)
      	at mondrian.rolap.RolapConnection$1.call(RolapConnection.java:626)
      	... 5 more
      Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
      	at java.util.TimSort.mergeLo(TimSort.java:747)
      	at java.util.TimSort.mergeAt(TimSort.java:483)
      	at java.util.TimSort.mergeCollapse(TimSort.java:410)
      	at java.util.TimSort.sort(TimSort.java:214)
      	at java.util.TimSort.sort(TimSort.java:173)
      	at java.util.Arrays.sort(Arrays.java:659)
      	at java.util.Collections.sort(Collections.java:217)
      	at mondrian.olap.fun.FunUtil.hierarchizeMemberList(FunUtil.java:822)
      	at mondrian.olap.fun.FunUtil.hierarchizeTupleList(FunUtil.java:842)
      	at mondrian.olap.fun.FunUtil.levelMembers(FunUtil.java:2164)
      	at mondrian.olap.fun.LevelMembersFunDef$1.evaluateList(LevelMembersFunDef.java:37)
      	at mondrian.calc.impl.AbstractListCalc.evaluateIterable(AbstractListCalc.java:71)
      	at mondrian.olap.fun.OrderFunDef$CalcImpl.evaluateDual(OrderFunDef.java:158)
      	at mondrian.olap.fun.OrderFunDef$ContextCalc.evaluate(OrderFunDef.java:352)
      	at mondrian.calc.impl.GenericIterCalc.evaluateIterable(GenericIterCalc.java:72)
      	at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:793)
      	at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:636)
      	at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:593)
      	at mondrian.rolap.RolapResult.<init>(RolapResult.java:286)
      	at mondrian.rolap.RolapConnection.executeInternal(RolapConnection.java:677)
      	... 8 more
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ddosch Dan Dosch
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: