如何解决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)是否不适用于此类查询?
解决方法
查询看起来正确,但是查询中使用的表名与创建的表名不同。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。