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));
- your understanding correct.
- 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
Post a Comment