Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Cassandra: Get the token value for given partition key

The Token function allows to compute the token for a given partition key.

cqlsh> SELECT * FROM cassandratutorial.employee;

id | age | firstname | lastname
----+-----+-----------+----------
1 | 30 | Krishna | Gurram
2 | 31 | Ram | Gurram
4 | 45 | Chitra | Rajan
3 | 45 | Vijay | Ponnam

(4 rows)
cqlsh>
cqlsh> SELECT id, TOKEN(id) from cassandratutorial.employee;

id | system.token(id)
----+----------------------
1 | -4069959284402364209
2 | -3248873570005575792
4 | -2729420104000364805
3 | 9010454139840013625

(4 rows)



Previous                                                    Next                                                    Home


This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

Cassandra: Get the token value for given partition key

×

Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×