我正在同时执行以下查询在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