Cassandra Select查询返回允许过滤,即使该列位于主键中

问题描述

我已经创建了一个订单表,就像这样

create_query1 = CREATE TABLE IF NOT EXISTS orders
    (status text,city text,company text,country_id text,created_at timestamp,customer_address_id text,customer_id text,discount_amount float,discount_invoiced float,email text,entity_id text,firstname text,free_shipping float,grand_total_final float,is_qty_decimal float,is_virtual text,item_id text,lastname text,method text,name text,no_discount float,order_id text,original_price float,parent_id text,postcode text,price float,price_incl_tax float,product_id text,product_type text,qty_ordered float,qty_shipped float,quote_item_id text,PRIMARY KEY ((order_id),created_at ))

当我查询类似

SELECT * from orders where created_at >= '2019-01-31 20:55:43' and created_at <= '2019-05-13 13:58:15'

我收到此错误

Error from server: code=2200 [Invalid query] message="Cannot execute this query as it might involve data filtering and thus may have unpredictable performance. If you want to execute this query despite the performance unpredictability,use ALLOW FILTERING"

在这里做错了什么? 卡桑德拉(Cassandra)是否不适用于此类查询

解决方法

查询看起来正确,但是查询中使用的表名与创建的表名不同。