final StringCalc stringCalc = compiler.compileString(call.getArg(0));
SetType type = (SetType) call.getType();
Type elementType = type.getElementType();
if (elementType instanceof MemberType) {
final Hierarchy hierarchy = elementType.getHierarchy();
return new AbstractListCalc(call, new Calc[] {stringCalc}) {
public List evaluateList(Evaluator evaluator) {
String string = stringCalc.evaluateString(evaluator);
if (string == null) {
throw newEvalException(
MondrianResource.instance().NullValue.ex());
}
return parseMemberList(evaluator, string, hierarchy);
}
};
} else {
TupleType tupleType = (TupleType) elementType;
final Hierarchy[] hierarchies =
new Hierarchy[tupleType.elementTypes.length];
for (int i = 0; i < tupleType.elementTypes.length; i++) {
hierarchies[i] = tupleType.elementTypes[i].getHierarchy();
}
return new AbstractListCalc(call, new Calc[] {stringCalc}) {
public List evaluateList(Evaluator evaluator) {
String string = stringCalc.evaluateString(evaluator);
if (string == null) {
throw newEvalException(
MondrianResource.instance().NullValue.ex());