Get count of elements in Set type column in Cassandra

how to get the count of elements in a column in Cassandra (cql) which is of Set; eg; a Column in a table has value {'9970GBBHVOB61', '9970GBBHVOB62', '9970GBBHVOB6O'} .I want 3 to be returned from the query


unfortunately the Collections-support even in CQL Driver v2 is not perfect: you may add or delete items in upsert statements. But more on them, like doing an item select, asking for collection item's TTLs or asking for the collection's size, is not supported. So you have to

resultset: SELECT collection_column FROM ...

and then take item by resultset.one() or resultset.all() and get item.size() yourself. Sorry abut that.

链接地址: http://www.djcxy.com/p/78028.html

上一篇: f的行为如何:使用许多已定义的资源库合同进行查看?

下一篇: 获取Cassandra中Set type列的元素数