我是cassandra的新手,我试图插入笔记本电脑映射列表的员工,如下所示,'laptoplist'是一个UDT。卡桑德拉嵌套查询
cqlsh:sourceutilization> SELECT * from employee ;
id | laptoplist | name | type
----+-----------------------------------------------------------------------------------+-----------+------------
5 | [{laptopid: 5, cpu: 9, memory: 18, networkutilization: 25, diskutilization: 85}] | testname5 | staffType5
1 | [{laptopid: 1, cpu: 94, memory: 36, networkutilization: 13, diskutilization: 66}] | testname1 | staffType1
8 | [{laptopid: 8, cpu: 64, memory: 1, networkutilization: 15, diskutilization: 71}] | testname8 | staffType8
0 | [{laptopid: 0, cpu: 4, memory: 95, networkutilization: 20, diskutilization: 16}] | testname0 | staffType0
2 | [{laptopid: 2, cpu: 49, memory: 37, networkutilization: 20, diskutilization: 88}] | testname2 | staffType2
4 | [{laptopid: 4, cpu: 13, memory: 67, networkutilization: 67, diskutilization: 10}] | testname4 | staffType4
7 | [{laptopid: 7, cpu: 11, memory: 75, networkutilization: 75, diskutilization: 97}] | testname7 | staffType7
6 | [{laptopid: 6, cpu: 27, memory: 34, networkutilization: 2, diskutilization: 92}] | testname6 | staffType6
9 | [{laptopid: 9, cpu: 12, memory: 10, networkutilization: 19, diskutilization: 73}] | testname9 | staffType9
3 | [{laptopid: 3, cpu: 47, memory: 13, networkutilization: 72, diskutilization: 54}] | testname3 | staffType3
现在,我想查询类似下面,它是如何可能
select * from employee where laptoplist.networkutilization > 50;
仅供参考,我使用3.1版本的卡桑德拉。
由于提前, 哈利
[Cassandra - 带有非主键缺陷的WHERE子句]的可能重复(https://stackoverflow.com/questions/35524516/cassandra-where-clause-with-non-primary-key-disadvantages) – muru