0

我正在尝试使用 cassandrapython cqlengine 来访问 cassandra db,当列不是列表类型时,我能够进行过滤。

我收到以下错误消息:

d =cClass().filter(lastname='text',age=2,input__contains='a') 

Traceback (most recent call last):   
File "/usr/local/lib/python3.4/dist-packages/cqlengine-0.21.0-py3.4.egg/cqlengine/operators.py", line 43, 
    in get_operator KeyError: 'CONTAINS'  During handling of the above exception, another exception occurred:  
Traceback (most recent call last):   
File "<stdin>", line 1, in <module>   
File "/usr/local/lib/python3.4/dist-packages/cqlengine-0.21.0-py3.4.egg/cqlengine/models.py", line 562, in filter   
File "/usr/local/lib/python3.4/dist-packages/cqlengine-0.21.0-py3.4.egg/cqlengine/query.py", line 507, in filter   
File "/usr/local/lib/python3.4/dist-packages/cqlengine-0.21.0-py3.4.egg/cqlengine/operators.py", line 45, 
    in get_operator **cqlengine.operators.QueryOperatorException: contains doesn't map to a QueryOperator**
4

1 回答 1

0

看起来您正在使用一个非常旧(且已弃用)的 cqlengine 版本。如果可以,请升级到与DataStax 驱动程序集成的版本,该 APIcontains 从 3.1.0 版本开始就支持该版本。

于 2016-10-24T17:51:53.283 回答