DS 201: Exercise 3 – Partitions, 12th step in exercise
write a query to retrieve the video having a title of Cassandra Intro. Here the title column is not a part of partition key nor primary key. how to retrieve data in this case?
DS 201: Exercise 3 – Partitions, 12th step in exercise
write a query to retrieve the video having a title of Cassandra Intro. Here the title column is not a part of partition key nor primary key. how to retrieve data in this case?
yes, you are correct, you cannot retrieve a video by title from this table, as title
is not the partition key, unless you allow filtering (which scans the full table and is not performant).
CREATE TABLE videos_by_tag ( tag TEXT, video_id UUID, added_date TIMESTAMP, title TEXT, PRIMARY KEY ((tag), video_id) );
The solution to this step calls this out (see the "Partitions - Solutions" pdf). It's an exercise to check your understanding, and you got it right.
Hope this helps!
Thanks for the clarification. Where can I find the "partitions - solutions" pdf.
you can download a zip with the exercises and solutions from the course page, I copy the link for you here:
https://s3.amazonaws.com/datastaxtraining/documents/DS201-Exercises.zip
7 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use