Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cassandra:[无效查询]消息=";“主键列”;液化天然气“;不能限制_Cassandra_Cql - Fatal编程技术网

Cassandra:[无效查询]消息=";“主键列”;液化天然气“;不能限制

Cassandra:[无效查询]消息=";“主键列”;液化天然气“;不能限制,cassandra,cql,Cassandra,Cql,在cqlsh中执行以下查询时出错 查询 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; 错误: code=2200 [Invalid query] message="PRIMARY KEY column "lng" cannot be rest

在cqlsh中执行以下查询时出错

查询

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;
错误:

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;
从ragchuws.disc\u位置选择*,其中country\u code=91,lat>32,lat<100允许过滤;

lng

似乎有问题。如果我理解正确,那么除了最后一列之外,您必须对所有组合键列使用“=”运算符。最后一个(在您的情况下,lng)可以用“”限制


这里是链接:

如果我理解正确,除了最后一个组合键列之外,您必须对所有组合键列使用“=”运算符。最后一个(在您的情况下,lng)可以用“”限制


这里的链接是:

您不能有这样的查询。您可以为where子句集群键的最后一部分添加
>或50,液化天然气<100;
甚至下面的方法也行

SELECT * FROM ragchews.disc_location WHERE country_code = 12 AND lat = 100.00 and lng = 50 and uid > '500' and uid  < '1000'
从ragchuws.disc\u位置选择*,其中国家/地区代码=12,纬度=100.00,液化天然气=50,液体>'500'和液体<'1000'

但是有
>或
的两个where子句将不起作用。

您不能有这样的查询。您可以为where子句集群键的最后一部分添加
>或50,液化天然气<100;
甚至下面的方法也行

SELECT * FROM ragchews.disc_location WHERE country_code = 12 AND lat = 100.00 and lng = 50 and uid > '500' and uid  < '1000'
从ragchuws.disc\u位置选择*,其中国家/地区代码=12,纬度=100.00,液化天然气=50,液体>'500'和液体<'1000'

但是有
>或
的两个where子句将不起作用。

是它们实现相同目的的任何方法。任何技巧/解决方法。我不想将大数据集存储在内存中并对其进行处理。他们有没有办法实现同样的效果。任何技巧/解决方法。我不想将大数据集存储在内存中并进行处理。我想知道我怎么会错过了你提到的链接中如此重要的一行。无论如何,重读这个链接是有帮助的+我想知道我怎么会错过你提到的链接中这么重要的一行。无论如何,重读这个链接是有帮助的+链接为1
SELECT * FROM ragchews.disc_location WHERE country_code = 12 AND lat = 100.00 and lng = 50 and uid > '500' and uid  < '1000'