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 CQL:过滤一系列值之间的行_Cassandra_Cql - Fatal编程技术网

Cassandra CQL:过滤一系列值之间的行

Cassandra CQL:过滤一系列值之间的行,cassandra,cql,Cassandra,Cql,我的专栏族的结构类似于 CREATE TABLE product ( id UUID PRIMARY KEY, product_name text, product_code text, status text,//in stock, out of stock mfg_date timestamp, exp_date timestamp ); 在状态、生产日期、产品代码和出口日期字段上创建二级索引 我想选择状态为库存且制造日期介于时间戳xxx

我的专栏族的结构类似于

CREATE TABLE product (
    id UUID PRIMARY KEY,
    product_name text, 
    product_code text,
    status text,//in stock, out of stock
    mfg_date timestamp,
    exp_date timestamp

);
在状态、生产日期、产品代码和出口日期字段上创建二级索引

我想选择状态为库存且制造日期介于时间戳xxxx到xxxx之间的产品列表

因此,我尝试了以下查询

SELECT * FROM product where status='IS' and mfg_date>= xxxxxxxxx and mfg_date<= xxxxxxxxxx LIMIT 50 ALLOW FILTERING;
它抛出错误,就像在带有等于运算符的by columns子句中没有索引列一样


结构上有什么我需要改变的吗?请帮帮我。提前感谢。

cassandra不支持>=因此您必须更改值,并且只能使用>大于和您应该在where子句中的一个索引或主键列字段上至少有一个equals运算符,即mfg_date=xxxxx