I am trying to have a column family that I can have a key for one CQL to get a row based on a key and another CQL to where I have a list of keys using the "IN" keyword and have an ORDER BY clause. The data I am getting is from the Column value not the Column Name. The issue I am having is trying to setup the column family to achieve this. I have this cli command to create the column family but when I go do an insert I get a odd exception about the Primary key. Below is the cli and the error when doing the insert of column values after the column family was created.
The cli command used to create the column family:
create column family video_item_details
with key_validation_class = 'CompositeType(IntegerType,UTF8Type)'
and comparator = 'UTF8Type'
and column_metadata = [
{column_name : key, validation_class: IntegerType, index_type: KEYS}
{column_name : name, validation_class : 'UTF8Type', index_type: KEYS}
{column_name : description, validation_class :'UTF8Type'}
{column_name : url, validation_class : 'UTF8Type'}
{column_name : play_time, validation_class : 'UTF8Type'}
{column_name : type, validation_class : 'UTF8Type'}
]
with caching='ALL';
the error during insert is:
Error while inserting com.datastax.driver.core.exceptions.InvalidQueryException: Missing mandatory PRIMARY KEY part key2
The insert statement that was being attempted to be executed was:
INSERT INTO video.video_item_details(key, name, description, url, play_time, type) values
(1,'Gettysburg','Gettysburg Movie Trailer','test','2:53','Streaming')
Thanks for any advice on how to get Cassandra to do this type of query.
Best Regards, -Tony