小编Iva*_*nyy的帖子

具有1个EQ限制和ORDER BY的cql3查询

使用CF:

CREATE TABLE history (
  domain text,
  iid text,
  timeid timeuuid,
  data text,
  comments text,
  PRIMARY KEY (domain, iid, timeid)
);
Run Code Online (Sandbox Code Playgroud)

我想像这样查询:

select domain, iid, timeid, data, comments from mappings
where domain = 'a' and iid = 'b'  order by timeid desc;
Run Code Online (Sandbox Code Playgroud)

但它失败并出现以下错误(cassandra 1.1.5):

Bad Request: Order by currently only support the ordering of columns following their declared order in the PRIMARY KEY
Run Code Online (Sandbox Code Playgroud)

我做错了吗?可能的解决方法是什么?谢谢

PS我使用单一的EQ限制和ORDER BY,但我需要至少2个限制和排序.

cassandra cql3

8
推荐指数
1
解决办法
5914
查看次数

标签 统计

cassandra ×1

cql3 ×1