How can I get the primary keys of all records in Cassandra?
问题 I have inserted plenty of data into Cassandra. Now I'd like to randomly query one record. But I don't know the primary key . So I want a way to fetch the primary keys of all data in Cassandra,then I can use one random primary key to query the data. Can I get it from the data directory of Cassandra? I only found .db files in that directory. 回答1: Which version of Cassandra are you on? If you're on Cassandra 3, you could query system_schema.columns from the command line, and grep for the PRIMARY