Partition key only in Cassandra -


in cassandra, understand default, given primary key(id1, id2), id1 partition key , id2 clustering key.

i want know if can define 2 partition keys without clustering key follows:

primary key ((id1, id2)); 

  1. your understanding correct.
  2. your primary key ((id1, id2)) correct , specifying one partition key consisting of two columns.

in second case, can query data specifying both columns values. eg:

select * mytable id1=1 , id2=3; 

and queries like:

select * mytable id1=1; 

will fail because id2 is part of primary key.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -