Search code examples
cassandracassandra-2.0datastaxdatastax-enterprise

Is there a way to easily calculate the token given a partition key?


I have a UUID partition key that I'd like to calculate its token for. Can this be done easily? I know there's nodetool getendpoints and nodetool getsstables, but I haven't found a nodetool utility for this.


Solution

  • Let's say your partition key is partition,

    Execute SELECT token(yourColumn) FROM keyspace.table WHERE yourColumn ='partition' LIMIT 1

    You'll get the token value of your partition key.