CF架构:
CREATE TABLE mytable (
upperId int,
lowerId int,
hour timestamp,
counter text,
succ int,
fail int,
PRIMARY KEY ((upperId, lowerId), hour, counter));
每条记录都由复合id upperId:lowerid键入,如何使用CQL3进行multiget?
这是无效的:
select * from mytable where (upperid, lowerid) in ((10000, 1), (10000, 2), (20000, 1));
我也不能这样做:
select * from mytable where (upperid = 10000 and lowerid in (1, 2)) or (upperid = 20000 and lowerid = 1);
我收到错误:')'缺少EOF。
请指出在CQL3中为复合行键执行multiget的有效方法。
谢谢, 威廉
答案 0 :(得分:1)
CQL尚不支持select语句中的逻辑“或”。
相反,在您的应用程序中,您可以组合两个查询的结果集:
select * from mytable where upperid = 10000 and lowerid in (1, 2);
select * from mytable where upperid = 20000 and lowerid = 1;
参考: