0
votes

As far as I know, a comparator is specified on the column family level. So far I have use it with dynamic columns (wide-rows). Which type of comparator is Cassandra using when you create a static column family using CQL?

CREATE TABLE songs (
  id uuid PRIMARY KEY,
  title text,
  album text,
  artist text,
  data blob
);

and what happens if you throw a composite key into the mix.

CREATE TABLE songs (
  id uuid,
  title text,
  album text,
  artist text,
  data blob,
  PRIMARY KEY ((id, title), album)
);
1

1 Answers

2
votes

http://cassandra.apache.org/doc/cql3/CQL.html#createTablepartitionClustering

http://www.datastax.com/documentation/cql/3.1/cql/ddl/ddl_compound_keys_c.html

On a given physical node, rows for a given partition key are stored in the order induced by the clustering columns.

So in the 2nd case your partition key is (id, title), and clustering key is album, meaning all the rows for a given partition key will be stored ordered by album