我正在同時執行以下查詢在cqlsh卡桑德拉:[無效查詢]消息=「PRIMARY KEY列 」LNG「 不能被限制
查詢錯誤
SELECT * FROM ragchews.disc_location WHERE country_code = 12 AND lat > 100.00 and lat < 120.00 and lng > 50 and lng < 100 allow filtering;
表
CREATE TABLE ragchews.disc_location (
country_code int,
lat float,
lng float,
uid text,
PRIMARY KEY (country_code, lat, lng, uid)
);
錯誤:
code=2200 [Invalid query] message="PRIMARY KEY column "lng" cannot be restricted (preceding column "ColumnDefinition{name=lat, type=org.apache.cassandra.db.marshal.FloatType, kind=CLUSTERING_COLUMN, componentIndex=0, indexName=null, indexType=null}" is either not restricted or by a non-EQ relation)"
卡桑德拉版本
[cqlsh 5.0.1 | Cassandra 2.1.2 | CQL spec 3.2.0 | Native protocol v3]
編輯1
下面的查詢工作正常,我
SELECT * FROM ragchews.disc_location WHERE country_code=91 and lat > 32 and lat < 100 allow filtering;
這看起來像什麼是錯與列。
是他們的任何方式來實現相同。任何技巧/解決方法。我不想將大數據集放入內存並處理它。 – guptakvgaurav 2014-12-02 14:43:03