cassandra select查询返回allow filtering,即使列位于主键中

5cg8jx4n  于 2021-06-13  发布在  Cassandra
关注(0)|答案(1)|浏览(457)

我创建了一个orders表,类似于

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不适合这种类型的查询吗?

nlejzf6q

nlejzf6q1#

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

相关问题