Cassandra UDT搜索列表集合

时间:2018-06-07 06:49:02

标签: cassandra cql user-defined-types

我在Cassandra有这个结构

CREATE TYPE IF NOT EXISTS json_test.sensor_frame (
    id_secret text,
    raw text,
);

CREATE TABLE IF NOT EXISTS json_test.json_table (
    user_id text,
    timestamp timestamp,
    device_id text,
    sensor_key text,
    sensor_values list<FROZEN<sensor_frame>>,
    PRIMARY KEY ((user_id, device_id), timestamp, sensor_key)
) WITH CLUSTERING ORDER BY (timestamp DESC) AND caching = {'keys': 'ALL', 'rows_per_partition': '1000'};

我想搜索字段id_secret的值。

我一直在尝试这些查询而没有任何成功:

select sensor_values from json_test.json_table where sensor_values = { id_secret: '703468940' };
select sensor_values from json_test.json_table where sensor_values LIKE {%id_secret: '703468940'%} allow filtering;
select sensor_values from json_test.json_table where sensor_values CONTAINS {id_secret: '703468940'} allow filtering;

是否可以进行查询?我应该更改进行此类查询的结构吗?

0 个答案:

没有答案