// Procedure Parameters
if (params.length != expectedParams) {
Map<String, Object> m = new LinkedHashMap<String, Object>();
for (ProcParameter catalog_param : CatalogUtil.getSortedCatalogItems(catalog_proc.getParameters(), "index")) {
VoltType vtype = VoltType.get(catalog_param.getType());
String key = String.format("[%02d]", catalog_param.getIndex());
String val = vtype.name();
if (vtype == VoltType.TIMESTAMP) {
val += " (FORMATS: ";
String add = "";
int spacer = val.length();
for (String f : VoltTypeUtil.DATE_FORMAT_PATTERNS) {
val += add + f;
add = "\n" + StringUtil.repeat(" ", spacer);
}
val += ")";
}
m.put(key, val);
}
throw new Exception(String.format("Incorrect number of parameters for %s. Expected %d, but was only given %d\n" +
"Expected Input Parameters:\n%s",
catalog_proc, catalog_proc.getParameters().size(), params.length,
StringUtil.prefix(StringUtil.formatMaps(m), " ")).trim());
}
// Convert parameters to the proper type
Object parameters[] = new Object[expectedParams];
for (int i = 0; i < expectedParams; i++) {
ProcParameter catalog_param = catalog_proc.getParameters().get(i);
assert(catalog_param != null) : String.format("Null %s parameter at %d", catalog_proc.getName(), i);
VoltType vt = VoltType.get(catalog_param.getType());
try {
// Split into array
if (catalog_param.getIsarray()) {
List<String> arr = (List<String>)CollectionUtil.addAll(new ArrayList<String>(),