how to get the count of elements in a column in Cassandra (cql) which is of Set; e.g; 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With