2
多列
我的表:范围在卡桑德拉
CREATE TABLE user_position (
geopart text, // first 3 characters of geohash
geohash text,
datetime timestamp,
userId bigint,
PRIMARY KEY ((geopart), geohash, datetime, user_id)
);
我哑查询:
select * from user_position where geopart = 'abc' and geohash > 'a' and geohash < 'z' and datetime >= '2015-08-08 15:08:58+0530';
错误:
Bad Request: PRIMARY KEY column "datetime" cannot be restricted (preceding column "geohash" is restricted by a non-EQ relation)
问:
我在做什么错?如果在Cassandra中不可能有多个列的范围,那我该如何实现呢?
我可以在范围查询之后放置一个'IN'查询吗? –
不,一旦你在Cassandra的某个列上使用范围进行过滤,你甚至不能在随后的聚类列上使用=过滤器。 –