keyspace.doExecuteOperation(new Operation<V>(OperationType.WRITE) {
@Override
public V execute(Client cassandra) throws HectorException {
Object queryResult = null;
try {
CqlResult result = cassandra.execute_cql_query(query,
useCompression ? Compression.GZIP : Compression.NONE);
if (log.isDebugEnabled()) {
log.debug("Found CqlResult: {}", result);
}
switch (result.getType()) {
case VOID:
break;
case INT:
queryResult = result.getNum(); //TODO this may be not correct as there seems to be no way to obtain affected columns/rows
break;
default:
throw new IllegalArgumentException(String.format("query returned result rows. use %s instead", CqlQuery.class));
}