Correction: year and category form a “composite partition key”.

frequency, word1, and word2 are “clustering columns”.

The combination of a partition key with clustering columns is a “compound 
primary key”.

Every CQL row will have a partition key by definition, and may optionally have 
clustering columns.

“The key” should just be a synonym for “primary key”, although sometimes people 
are loosely speaking about “the partition” (which should be “the partition 
key”) rather than the CQL “row”.

-- Jack Krupansky

From: Chamila Wijayarathna 
Sent: Tuesday, December 16, 2014 8:03 AM
To: user@cassandra.apache.org 
Subject: Understanding what is key and partition key

Hello all,  

I have read a lot about Cassandra and I read about key-value pairs, partition 
keys, clustering keys, etc.. 
Is key mentioned in key-value pair and partition key refers to same or are they 
different?

CREATE TABLE corpus.bigram_time_category_ordered_frequency (
    id bigint,
    word1 varchar,
    word2 varchar,
    year int,
    category varchar,
    frequency int,
    PRIMARY KEY((year, category),frequency,word1,word2)
);
In this schema, I know (year, category) is the compound partition key and 
frequency is the clustering key. What is the key here?


Thank You! 


-- 

Chamila Dilshan Wijayarathna,
SMIEEE, SMIESL,
Undergraduate,
Department of Computer Science and Engineering,
University of Moratuwa.

Reply via email to