【发布时间】:2016-12-10 13:23:45
【问题描述】:
我创建了一个表“测试”,并使用以下命令使用 CQL 插入了一些值。
create table testt(val map<text,text>, id text primary key);
insert into testt (val,id) values ({'key':'1'},'1');
当我使用以下查询检索时,它可以工作
select * from testt where val['key']='1' allow filtering;
我需要检索多个值,这些值都包含 val[ 钥匙']。使用下面的命令抛出错误。
select * from testt where val['key'] IN( '1' ) allow filtering;
SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:37 no viable alternative at input 'IN' (... testt where val['key'] [IN]...)">
是否有任何其他方式或方法可以获得所需的输出?
【问题讨论】:
-
你好。有什么需要?对馆藏的搜索非常复杂。您可能可以使用其他模型更轻松地搜索所需值。例如使用搜索表。
标签: cassandra cassandra-2.0 cql cql3 cqlsh