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

ClassCastException in CrossJoinArgFactory.allArgsCheapToExpand when defining a NamedSet as another NamedSet

    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

      Have a query that looks something like:

      WITH
      MEMBER [Time].[Base] AS ([Time].[Epoch].[1297728000])
      MEMBER [Measures].[date] AS [Time].CurrentMember.Name
      MEMBER [Time].[Slicer] AS ([Time].[Epoch].[1298332800])
      SET [Available] AS FILTER([Dim].[Level].Members, CAST([Dim].CurrentMember.Key AS NUMERIC) > 0)
      SET [CrossRows] AS [Time].[Epoch].[1298332800]:[Time].[Epoch].[1298332800]
      SET [Filtered] AS FilteringUDF([Available], "condition")
      SET [Requested] AS [Filtered]
      SELECT

      { HEAD(CROSSJOIN([Requested], [CrossRows]), 10000) }

      ON ROWS,

      { [Measures].Members }

      ON COLUMNS
      FROM
      Our_Cube

      and get the following exception:

      Caused by: java.lang.ClassCastException: mondrian.mdx.NamedSetExpr cannot be cast to mondrian.mdx.ResolvedFunCall
      at mondrian.rolap.sql.CrossJoinArgFactory.allArgsCheapToExpand(CrossJoinArgFactory.java:936)
      at mondrian.rolap.sql.CrossJoinArgFactory.isCheapSet(CrossJoinArgFactory.java:926)
      at mondrian.rolap.sql.CrossJoinArgFactory.shouldExpandNonEmpty(CrossJoinArgFactory.java:920)
      at mondrian.rolap.sql.CrossJoinArgFactory.expandNonNative(CrossJoinArgFactory.java:898)
      at mondrian.rolap.sql.CrossJoinArgFactory.checkCrossJoin(CrossJoinArgFactory.java:345)
      at mondrian.rolap.RolapNativeCrossJoin.createEvaluator(RolapNativeCrossJoin.java:105)
      at mondrian.rolap.RolapNativeRegistry.createEvaluator(RolapNativeRegistry.java:56)
      at mondrian.rolap.RolapSchemaReader.getNativeSetEvaluator(RolapSchemaReader.java:612)
      at mondrian.olap.DelegatingSchemaReader.getNativeSetEvaluator(DelegatingSchemaReader.java:235)
      at mondrian.olap.fun.CrossJoinFunDef$BaseListCalc.evaluateList(CrossJoinFunDef.java:1168)
      at mondrian.olap.fun.HeadTailFunDef$1.evaluateList(HeadTailFunDef.java:65)
      at mondrian.calc.impl.AbstractListCalc.evaluateTupleList(AbstractListCalc.java:89)
      at mondrian.olap.fun.SetFunDef$TupleSetListCalc$1.evaluateVoid(SetFunDef.java:259)
      at mondrian.olap.fun.SetFunDef$TupleSetListCalc.evaluateTupleList(SetFunDef.java:298)
      at mondrian.calc.impl.AbstractExpCompiler$TupleListIterCalc.evaluateTupleIterable(AbstractExpCompiler.java:615)
      at mondrian.calc.impl.AbstractTupleIterCalc.evaluate(AbstractTupleIterCalc.java:52)
      at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:732)
      at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:575)
      at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:541)
      at mondrian.rolap.RolapResult.<init>(RolapResult.java:273)
      at mondrian.rolap.RolapConnection.execute(RolapConnection.java:593)

      working on a new unit test for this issue now, but changing the "if (exp instanceof NamedSetExpr)" to "while (exp instanceof NamedSetExpr)" at the top of #allArgsCheapToExpand() seems to fix the problem and all existing unit tests pass. Will upload a diff w/ unit test once I have one put together.

        Attachments

          Activity

            People

            • Assignee:
              sgururaja Suhas Gururaja
              Reporter:
              jbarnett Joe Barnett
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: