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的某個列上使用範圍進行過濾,你甚至不能在隨後的聚類列上使用=過濾器。 –