Question

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?

Was it helpful?

Solution

You appear to have your key and column name transposed. For keys you have: "fahrer2" on the mutator and "first" on the CQL query.

If you have not already, please see the following for more on CQL in Hector (and in general): https://github.com/rantav/hector/wiki/Using-CQL

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top