문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top