use of mondrian.calc.impl.DelegatingTupleList 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;
}
Aggregations