小编Rim*_*der的帖子

Cassandra 有两个主键并使用第二个

我在 Cassandra 中创建了下一个表

create table yyy (
 index1 int,
 index2 int,
 name text,
 primary key ((index1, index2), name)
)
Run Code Online (Sandbox Code Playgroud)

当我只按 index1 搜索时,完美。没关系!

select * from yyy where index1 ...
Run Code Online (Sandbox Code Playgroud)

买我不能按 index2 搜索

ReadFailure:来自服务器的错误:code=1300 [Replica(s) failed to execute read] message="操作失败 - 收到 0 个响应和 1 个失败" info={'failures': 1, 'received_responses': 0, 'required_responses' : 1, '一致性': 'ONE'}

如何按index2搜索?

cassandra cassandra-3.0

3
推荐指数
1
解决办法
1188
查看次数

标签 统计

cassandra ×1

cassandra-3.0 ×1