【发布时间】:2024-01-19 05:37:01
【问题描述】:
我的列族的结构类似于
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
);
二级索引是在 status、mfg_date、product_code 和 exp_date 字段上创建的。
我想选择状态为 IS(In Stock)且生产日期在时间戳 xxxx 到 xxxx 之间的产品列表。
所以我尝试了以下查询。
SELECT * FROM product where status='IS' and mfg_date>= xxxxxxxxx and mfg_date<= xxxxxxxxxx LIMIT 50 ALLOW FILTERING;
它会抛出类似 No indexed columns present in by-columns 子句中带有“equals”运算符的错误。
我需要对结构进行更改吗?请帮帮我。提前致谢。
【问题讨论】: