Cassandra不使用CQL更新数据,而是使用mutator来更新数据

|| 使用以下代码,我尝试更新一行
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\"));
不执行CQL查询的更新,而是使用增幅器进行更新。错误在哪里?     
已邀请:
        您似乎已调换了键名和列名。对于键,您有: mutator上的\“ fahrer2 \”和CQL查询上的\“ first \”。 如果您还没有,请参阅以下内容,了解有关Hector(以及一般而言)中CQL的更多信息: https://github.com/rantav/hector/wiki/Using-CQL     

要回复问题请先登录注册