cassandra 查询和排序
这是我表的创建语句
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问题就出现了,请大家多多帮忙