Expression[] args = function.getArgs();
for (int i = 0; i < params; i++) {
args[i] = args[i].optimize(session);
columnListArgs[i] = args[i];
}
ValueResultSet template = function.getValueForColumnList(session, columnListArgs);
if (template == null) {
throw DbException.get(ErrorCode.FUNCTION_MUST_RETURN_RESULT_SET_1, function.getName());
}
ResultSet rs = template.getResultSet();
try {
ResultSetMetaData meta = rs.getMetaData();
int columnCount = meta.getColumnCount();
Column[] cols = new Column[columnCount];
for (int i = 0; i < columnCount; i++) {