Use nodetool
to verify that Cassandra is running. (You may need to run this command multiple times.)
✅ Verify that Cassandra is running.
nodetool status
✅ Start 'cqlsh' so you can execute CQL statements:
cqlsh
✅ Switch to the killrvideo keyspace via the USE
command:
Solution
USE killrvideo;
✅ Execute the following command to view information about the videos table:
DESCRIBE TABLE videos;
Question: What is the partition key for the videos table?
Answer
The video_id column is the primary key.
Question: How many partitions are in the videos table?
Answer
One partition for each unique video_id.
Note: This table has a single row in each partition rather than using partitions to group related rows. This is an anti-pattern!
✅ Execute the following query to see how partition key values are mapped to tokens by the partitioner:
SELECT token(video_id), video_id FROM videos;
✅ Exit cqlsh:
quit