Search in sources :

Example 1 with TraversalList

use of mondrian.util.TraversalList in project mondrian by pentaho.

the class HighCardSqlTupleReader method readTuples.

public TupleList readTuples(final DataSource jdbcConnection, final TupleList partialResult, final List<List<RolapMember>> newPartialResult) {
    prepareTuples(jdbcConnection, partialResult, newPartialResult, targets);
    // List of tuples
    final int n = targets.size();
    @SuppressWarnings({ "unchecked" }) final List<Member>[] lists = new List[n];
    for (int i = 0; i < n; i++) {
        lists[i] = targets.get(i).close();
    }
    final List<List<Member>> list = new TraversalList<Member>(lists, Member.class);
    TupleList tupleList = new DelegatingTupleList(n, list);
    // need to hierarchize the columns from the enumerated targets
    // since we didn't necessarily add them in the order in which
    // they originally appeared in the cross product
    int enumTargetCount = getEnumTargetCount();
    if (enumTargetCount > 0) {
        tupleList = FunUtil.hierarchizeTupleList(tupleList, false);
    }
    return tupleList;
}
Also used : DelegatingTupleList(mondrian.calc.impl.DelegatingTupleList) UnaryTupleList(mondrian.calc.impl.UnaryTupleList) TupleList(mondrian.calc.TupleList) TraversalList(mondrian.util.TraversalList) DelegatingTupleList(mondrian.calc.impl.DelegatingTupleList) UnaryTupleList(mondrian.calc.impl.UnaryTupleList) TupleList(mondrian.calc.TupleList) TraversalList(mondrian.util.TraversalList) TupleConstraint(mondrian.rolap.sql.TupleConstraint) DelegatingTupleList(mondrian.calc.impl.DelegatingTupleList)

Aggregations

TupleList (mondrian.calc.TupleList)1 DelegatingTupleList (mondrian.calc.impl.DelegatingTupleList)1 UnaryTupleList (mondrian.calc.impl.UnaryTupleList)1 TupleConstraint (mondrian.rolap.sql.TupleConstraint)1 TraversalList (mondrian.util.TraversalList)1