{
CFDefinition.Name name = cfDef.get(columnNames.get(i));
if (name == null)
throw new InvalidRequestException(String.format("Unknown identifier %s", columnNames.get(i)));
Operation operation = columnOperations.get(i);
for (Term t : operation.getValues())
if (t.isBindMarker())
boundNames[t.bindIndex] = name;
switch (name.kind)
{
case KEY_ALIAS:
case COLUMN_ALIAS:
if (processedKeys.containsKey(name.name))
throw new InvalidRequestException(String.format("Multiple definitions found for PRIMARY KEY part %s", name));
if (operation.getType() != Operation.Type.COLUMN)
throw new InvalidRequestException(String.format("Invalid definition for %s, not a collection type", name));
processedKeys.put(name.name, operation.getValues());
break;
case VALUE_ALIAS:
case COLUMN_METADATA:
if (processedColumns.containsKey(name))
throw new InvalidRequestException(String.format("Multiple definitions found for column %s", name));
processedColumns.put(name, operation);
break;
}
}
}
else
{
// Created from an UPDATE
for (Pair<ColumnIdentifier, Operation> entry : columns)
{
CFDefinition.Name name = cfDef.get(entry.left);
if (name == null)
throw new InvalidRequestException(String.format("Unknown identifier %s", entry.left));
switch (name.kind)
{
case KEY_ALIAS:
case COLUMN_ALIAS:
throw new InvalidRequestException(String.format("PRIMARY KEY part %s found in SET part", entry.left));
case VALUE_ALIAS:
case COLUMN_METADATA:
for (Operation op : processedColumns.get(name))
if (op.getType() == Operation.Type.COLUMN)
throw new InvalidRequestException(String.format("Multiple definitions found for column %s", name));
Operation op = entry.right;
for (Term t : op.getValues())
if (t.isBindMarker())
boundNames[t.bindIndex] = name;
processedColumns.put(name, op);
break;
}