You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Christian Straube <Ch...@gmx.de> on 2011/06/18 12:14:41 UTC

Cassandra is not updating data with CQL, with mutator it does

Hi,

with the following code I try to update a row

Keyspace fKeyspace = HFactory.createKeyspace(KEYSPACE, fCluster);

// Update with CQL
CqlQuery<String,String,String> cqlQuery =
   new CqlQuery<String,String,String>(fKeyspace, fStringS, fStringS, fStringS);
cqlQuery.setQuery(
    "INSERT INTO Fahrer (KEY, 'first') VALUES('fahrer1', 'FirstnameUpdated')");
QueryResult<CqlRows<String,String,String>> result = cqlQuery.execute();

// Update with mutator
Mutator<String> mutator = HFactory.createMutator(fKeyspace, fStringS);
MutationResult mr = mutator.insert("fahrer2", "Fahrer",
   HFactory.createStringColumn("first", "SecondUpdated"));

The update of the CQL-query is not performed, the update with the mutator is performed. Where is the mistake?

Thank you very much!!

Best
Christian