Understanding what is key and partition key

2014-12-16 Thread Chamila Wijayarathna
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.


Re: Understanding what is key and partition key

2014-12-16 Thread Jack Krupansky
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.


Re: Understanding what is key and partition key

2014-12-16 Thread Chamila Wijayarathna
Hi Jack,

So what will be the keys and values of the following CF instance?

year | category | frequency | word1| word2   | id
--+--+---+--+-+---
 2014 |N | 1 |සියළුම | යුද්ධ |   664
 2014 |N | 1 |එච් |   කාණ්ඩය | 12526
 2014 |N | 1 |ගජබා | සුපර්ක්‍රොස් | 25779
 2014 |N | 1 |  බී|   කාණ්ඩය | 12505

Thank You!

On Tue, Dec 16, 2014 at 6:45 PM, Jack Krupansky j...@basetechnology.com
wrote:

   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 cdwijayarat...@gmail.com
 *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.



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


Re: Understanding what is key and partition key

2014-12-16 Thread Jens Rantil
For the first row, the key is: (2014, N, 1, සියළුම, යුද්ධ) and the value-part 
is (664).




Cheers,

Jens


———
Jens Rantil
Backend engineer
Tink AB

Email: jens.ran...@tink.se
Phone: +46 708 84 18 32
Web: www.tink.se

Facebook Linkedin Twitter

On Tue, Dec 16, 2014 at 2:25 PM, Chamila Wijayarathna
cdwijayarat...@gmail.com wrote:

 Hi Jack,
 So what will be the keys and values of the following CF instance?
 year | category | frequency | word1| word2   | id
 --+--+---+--+-+---
  2014 |N | 1 |සියළුම | යුද්ධ |   664
  2014 |N | 1 |එච් |   කාණ්ඩය | 12526
  2014 |N | 1 |ගජබා | සුපර්ක්‍රොස් | 25779
  2014 |N | 1 |  බී|   කාණ්ඩය | 12505
 Thank You!
 On Tue, Dec 16, 2014 at 6:45 PM, Jack Krupansky j...@basetechnology.com
 wrote:

   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 cdwijayarat...@gmail.com
 *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.

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

Re: Understanding what is key and partition key

2014-12-16 Thread Chamila Wijayarathna
Hi Jens,

Thank You!

On Tue, Dec 16, 2014 at 7:03 PM, Jens Rantil jens.ran...@tink.se wrote:

 For the first row, the key is: (2014, N, 1, සියළුම, යුද්ධ) and the
 value-part is (664).

 Cheers,
 Jens

 ——— Jens Rantil Backend engineer Tink AB Email: jens.ran...@tink.se
 Phone: +46 708 84 18 32 Web: www.tink.se Facebook Linkedin Twitter


 On Tue, Dec 16, 2014 at 2:25 PM, Chamila Wijayarathna 
 cdwijayarat...@gmail.com wrote:

 Hi Jack,

 So what will be the keys and values of the following CF instance?

  year | category | frequency | word1| word2   | id
 --+--+---+--+-+---
  2014 |N | 1 |සියළුම | යුද්ධ |   664
  2014 |N | 1 |එච් |   කාණ්ඩය | 12526
  2014 |N | 1 |ගජබා | සුපර්ක්‍රොස් | 25779
  2014 |N | 1 |  බී|   කාණ්ඩය | 12505

 Thank You!

 On Tue, Dec 16, 2014 at 6:45 PM, Jack Krupansky j...@basetechnology.com
 wrote:

   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 cdwijayarat...@gmail.com
  *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.



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




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