I am shifting from RDBMS world to NoSQL world and hence have few challenges. My requirement is to create a table as
Modify the following command to create a new videos_by_tag table partitioned based on the tag. The table should also store the rows of each partition so that the newest videos are listed first within the partition>.
so I have created the table in the cassandra database as below hope this is correct
CREATE TABLE videos_by_tag (
tag text,
video_id timeuuid,
added_date timestamp,
title text,
PRIMARY KEY ((tag), video_id, added_date)
) WITH CLUSTERING ORDER BY (video_id ASC, added_date DESC);
and loaded the data. Select * from videos_by_tag output is
tag | video_id | added_date | title -----------+--------------------------------------+---------------------------------+--------------------datastax | 4845ed97-14bd-11e5-8a40-8338255b7e33 | 2013-10-16 00:00:00.00000 | DataStax Studio
datastax | 5645f8bd-14bd-11e5-af1a-8638355b8e3a | 2013-04-16 00:00:00.00000 | What is DataStax Enterprise?
cassandra | 1645ea59-14bd-11e5-a993-8138354b7e31 | 2014-01-29 00:00:00.00000 | Cassandra History
cassandra | 245e8024-14bd-11e5-9743-8238356b7e32 | 2012-04-03 00:00:00.0000 | Cassandra & SSDs
cassandra | 3452f7de-14bd-11e5-855e-8738355b7e3a | 2013-03-17 00:00:00.0000 | Cassandra Intro
My requirements are: