【发布时间】:2015-12-17 19:41:54
【问题描述】:
如何根据索引列删除cassandra中的行?
试过了:
upload_id 作为索引添加到表中。
Delete from table where upload_id = '"+uploadId+"'"但这给了我一个错误"NON PRIMARY KEY found in where clause"。String selectQuery = "Select hashkey from table where upload_id='" + uploadId + "'"
entityManager.createNativeQuery(selectQuery).getResultList()
并使用 for 循环删除 List 中的所有元素。
这个查询被 kundera 修改为追加LIMIT 100 ALLOW Filtering。
在Kundera for Cassandra - Deleting record by row key 发现了一个与此类似的问题,但在 2012 年被问到,之后 cassandra 和 Kundera 发生了很多变化。
【问题讨论】: