Skip to content

Latest commit

 

History

History
95 lines (76 loc) · 2.34 KB

step1.md

File metadata and controls

95 lines (76 loc) · 2.34 KB
Partitions ℹ️ For technical support, please contact us via email.
⬅️ Back Step 1 of 2 Next ➡️
Explore the videos table

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
⬅️ Back Next ➡️