cassandra 查询和排序

huluwa321 2016-09-14 01:42:08
这是我表的创建语句
CREATE TABLE post1 (
parent_id text,
like_sn int,
like blob,
like_type text,
PRIMARY KEY (parent_id, like_sn)
) WITH CLUSTERING ORDER BY (like_sn ASC) AND
bloom_filter_fp_chance=0.100000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.010000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'class': 'LeveledCompactionStrategy'} AND
compression={'sstable_compression': 'LZ4Compressor'};

我想做的查询如下:
select * from post where parent_id=? and like_sn>? and like_type=? order by like_sn desc limit ?;

错误启示:
InvalidRequest: code=2200 [Invalid query] message="ORDER BY with 2ndary indexes is not supported."

如果我把查询语句修改成这样就没有问题:
select * from post where parent_id=? and like_sn>? order by like_sn desc limit ?;
多一个条件like_type问题就出现了,请大家多多帮忙
...全文
1317 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

2,208

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 其他数据库
社区管理员
  • 其他数据库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧