Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何查询(CQL)具有一对多PK列关系的Cassandra复合PK表?_Cassandra_Cql_Composite Primary Key - Fatal编程技术网

如何查询(CQL)具有一对多PK列关系的Cassandra复合PK表?

如何查询(CQL)具有一对多PK列关系的Cassandra复合PK表?,cassandra,cql,composite-primary-key,Cassandra,Cql,Composite Primary Key,我有一张卡桑德拉桌子: PropertiesOfThing ------------------ thingID text propertyName text, propertyValue, primary key (thingID, propertyName) 记录可以是: thingID propertyName propertyValue 1 x v1x 1 y v1y 2 y v2y

我有一张卡桑德拉桌子:

PropertiesOfThing
------------------
thingID text
propertyName text,
propertyValue,
primary key (thingID, propertyName)
记录可以是:

thingID propertyName propertyValue
1       x            v1x
1       y            v1y
2       y            v2y

如何查找没有特定属性名称(例如x)的thingID?什么是正确的CQL?

做到这一点的“Cassandra”方法是为您可能要执行的每个select查询使用一个表-以这样一种方式对其进行建模,即查询是自然的。我应该如何对其进行建模以找出不具有propertyName=x的thingID(结果应该是thingID=2)-您能解释一下吗?您不能这样查询,但是您可以获得具有特定propertyName的thingID列表