Cassandra选择查询列表和冻结

时间:2017-10-30 07:18:23

标签: select cassandra cassandra-2.0 cassandra-3.0 spring-data-cassandra

我有用户定义类型

CREATE TYPE point ( pointId int, floor text);

我有这样的表:

CREATE TABLE path (
id timeuuid,
val timeuuid,
PointList list<frozen <point>>,
PRIMARY KEY(id,val)
);

并创建像

这样的索引
create index on path(PointList);

但问题是我无法在PointList = [floor:“abc”]中执行select查询。

我谷歌2个小时但无法找到提示。

我正在使用此查询执行选择查询

Select * from path where val = sdsdsdsdsds-dsdsdsd-dssds-sdsdsd and PointList contains {floor: 'eemiG8NbzdRCQ'};

我可以在我的cassandra表中看到这些数据,但无法使用上述查询获取该数据。

我想要选择查询,我们只能使用floorval。因为我们只有floor and val

的数据

我尝试了许多不同的方法,但没有任何工作。

我希望得到任何暗示或帮助。

谢谢,

1 个答案:

答案 0 :(得分:1)

冻结点意味着点类型被冻结,你不能部分提供点值,你必须提供点的全部值

示例查询:

select * from path where pointlist CONTAINS {pointId : 1, floor : 'abc'};