0
我已经将定位类型定义为一个静态列。如何查询cassandra使用静态列?
我想过滤静态列上的数据。
select count(*) from device_stats_by_location where locationtype = "garage";
但我面对的例外 -
InvalidRequest: code=2200 [Invalid query] message="Predicates on non-primary-key columns (locationtype) are not yet supported for non secondary index queries"
所以尝试...
cqlsh:device_data> CREATE INDEX locationtype_indx on device_stats_by_location (locationtype);
生成错误消息...
InvalidRequest: code=2200 [Invalid query] message="Secondary indexes are not allowed on static columns"
我的问题是 - 我如何在CQL查询中使用静态列?
为什么使用静态列?你的用例是什么? –
locationtype对于所有具有相同分区键的行都是固定的 –
DataType => ** locationid(Pk),endof10minwindow(Ck1),devicecategory(Ck2),devicecount,locationtype(S),region(S)** => for一个给定的位置ID将有2000行聚集在一起,它们将具有相同的位置类型和区域=>多数民众赞成为什么**指定它们为静态** =>什么是通过位置类型查询数据的最佳方法? –