Cassandra UDT在列表集合中搜索
我在卡桑德拉有这个结构Cassandra UDT在列表集合中搜索,cassandra,cql,user-defined-types,Cassandra,Cql,User Defined Types,我在卡桑德拉有这个结构 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_valu
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'};
可以进行查询吗?我是否应该更改进行此类查询的结构?此问题的可能重复项用于在UDT列表中搜索,而不是在UDT字段中搜索。同样的解决方案不适用
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;