Search in sources :

Example 16 with ResolvedFunCall

use of mondrian.mdx.ResolvedFunCall in project mondrian by pentaho.

the class RolapResult method processMemberExpr.

private static void processMemberExpr(Object o, List<Member> exprMembers) {
    if (o instanceof Member && o instanceof RolapCubeMember) {
        exprMembers.add((Member) o);
    } else if (o instanceof VisualTotalMember) {
        VisualTotalMember member = (VisualTotalMember) o;
        Exp exp = member.getExpression();
        processMemberExpr(exp, exprMembers);
    } else if (o instanceof Exp && !(o instanceof MemberExpr)) {
        Exp exp = (Exp) o;
        ResolvedFunCall funCall = (ResolvedFunCall) exp;
        Exp[] exps = funCall.getArgs();
        processMemberExpr(exps, exprMembers);
    } else if (o instanceof Exp[]) {
        Exp[] exps = (Exp[]) o;
        for (Exp exp : exps) {
            processMemberExpr(exp, exprMembers);
        }
    } else if (o instanceof MemberExpr) {
        MemberExpr memberExp = (MemberExpr) o;
        Member member = memberExp.getMember();
        processMemberExpr(member, exprMembers);
    }
}
Also used : MemberExpr(mondrian.mdx.MemberExpr) VisualTotalMember(mondrian.olap.fun.VisualTotalsFunDef.VisualTotalMember) ResolvedFunCall(mondrian.mdx.ResolvedFunCall) DummyExp(mondrian.calc.DummyExp) Exp(mondrian.olap.Exp) Member(mondrian.olap.Member) VisualTotalMember(mondrian.olap.fun.VisualTotalsFunDef.VisualTotalMember)

Example 17 with ResolvedFunCall

use of mondrian.mdx.ResolvedFunCall in project mondrian by pentaho.

the class CompoundPredicateInfo method makeCalculatedMemberPredicate.

private StarPredicate makeCalculatedMemberPredicate(RolapCubeMember member, RolapCube baseCube, Evaluator evaluator) {
    assert member.getExpression() instanceof ResolvedFunCall;
    ResolvedFunCall fun = (ResolvedFunCall) member.getExpression();
    final Exp exp = fun.getArg(0);
    final Type type = exp.getType();
    if (type instanceof SetType) {
        return makeSetPredicate(exp, evaluator);
    } else if (type.getArity() == 1) {
        return makeUnaryPredicate(member, baseCube, evaluator);
    } else {
        throw MondrianResource.instance().UnsupportedCalculatedMember.ex(member.getName(), null);
    }
}
Also used : Type(mondrian.olap.type.Type) SetType(mondrian.olap.type.SetType) SetType(mondrian.olap.type.SetType) ResolvedFunCall(mondrian.mdx.ResolvedFunCall) Exp(mondrian.olap.Exp)

Aggregations

ResolvedFunCall (mondrian.mdx.ResolvedFunCall)17 Exp (mondrian.olap.Exp)13 Member (mondrian.olap.Member)8 FunDef (mondrian.olap.FunDef)7 Type (mondrian.olap.type.Type)7 TupleType (mondrian.olap.type.TupleType)6 ArrayList (java.util.ArrayList)5 TupleList (mondrian.calc.TupleList)5 UnaryTupleList (mondrian.calc.impl.UnaryTupleList)5 MemberExpr (mondrian.mdx.MemberExpr)5 NullFunDef (mondrian.olap.fun.CrossJoinTest.NullFunDef)5 NullType (mondrian.olap.type.NullType)5 List (java.util.List)4 Calc (mondrian.calc.Calc)4 AggregateFunDef (mondrian.olap.fun.AggregateFunDef)4 ParenthesesFunDef (mondrian.olap.fun.ParenthesesFunDef)4 TestMember (mondrian.olap.fun.TestMember)4 SetType (mondrian.olap.type.SetType)4 Evaluator (mondrian.olap.Evaluator)3 DecimalType (mondrian.olap.type.DecimalType)3