RECOMMENDED PATHS
ArchitectLOGIN TO START THIS PATH
VIEW COURSES
0%
DS201: DataStax Enterprise 6 Foundations of Apache Cassandra™
0%
DS210: DataStax Enterprise 6 Operations with Apache Cassandra™
0%
DS220: DataStax Enterprise 6 Practical Application Data Modeling with Apache Cassandra™
0%
DS101: Introduction to Apache Cassandra™
DeveloperLOGIN TO START THIS PATH
VIEW COURSES
0%
DS201: DataStax Enterprise 6 Foundations of Apache Cassandra™
0%
DS220: DataStax Enterprise 6 Practical Application Data Modeling with Apache Cassandra™
0%
DS101: Introduction to Apache Cassandra™
Graph SpecialistLOGIN TO START THIS PATH
VIEW COURSES
0%
DS201: DataStax Enterprise 6 Foundations of Apache Cassandra™
0%
DS220: DataStax Enterprise 6 Practical Application Data Modeling with Apache Cassandra™
0%
DS330: DataStax Enterprise 6 Graph
0%
DS101: Introduction to Apache Cassandra™
UNIT CONTENTS
Unit Status
 
 
  Previous Unit: Fundamentals Of An Apache Cassandra T...
Finish & Next Unit: Clustering Columns  

DSE Version: 6.0

Partitioning And Storage Structure

Video

Exercises

We will be talking about partitioning and storage structure in this unit, both very important topics for Apache Cassandra data modeling.

NO TRANSCRIPT AVAILABLE.

No write up.

Exercise 2.1: Working with Partitions

In this exercise, you will:

  • Create a new table that allows querying videos by title and year using a composite partition key

Background

Your peers need to query videos based on 'title' and 'added_year'. The new columns for this table are:

Column NameData Type
titletext
added_yearint
added_datetimestamp
descriptiontext
user_iduuid
video_iduuid

Steps

1. Use a text editor to view the '/home/ubuntu/labwork/partitions/videos_by_title_year.csv' file.

2. At prompt, navigate to '/home/ubuntu/labwork/partitions/'.

3. Start 'cqlsh'

4. Create a second table in the 'killrvideo' keyspace called 'videos_by_title_year'with the structure shown in above table. Be sure users can query this table on both 'title' and 'added_year'by combining them into the partition key.

5. Load the data from the 'videos_by_title_year.csv'file using the `COPY` command.

6. COPY videos_by_title_year (title, added_year, added_date, description, user_id, video_id) FROM 'videos_by_title_year.csv' WITH HEADER=true;

7. Try running queries on the 'videos_by_title_year' table to query on a specific 'title' and 'added_year'.

Example queries:

titleadded_year
Introduction to Apache Cassandra2014
Grumpy Cat: Slow Motion2015
Grumpy Cat: Slow Motion2015
AzureDev2015

8. What error does Cassandra return when you try to query on just title or just year? Why?

9. Exit cqlsh.

No FAQs.
No resources.
Comments are closed.