My column family needs two composite columns, the key data type is BytesType.
Here is the definition of table using CQL:
CREATE TABLE stats (
gid blob,
period int,
tid blob,
sum int,
uniques blob,
PRIMARY KEY(gid, period, tid)
);
What I want to do is to create the column family but with Cassandra CLI. Here is my shot.
The structure of the first composite is:
CompositeType(Int32Type, BytesType, AsciiType)
and it will holds an integer.
The structure of the second composite is:
CompositeType(Int32Type, BytesType)
and will holds BytesType.
create column family stats with comparator = 'CompositeType(Int32Type, BytesType, AsciiType)';
I'm not sure how to define the second composite column in create column family command.
Of course I'm assuming that the table created with CQL will generate two composite columns.
You can only have one comparator on a column family in cassandra. This means you can also only have one type of composite column in column family. The table created by the CQL statement you used would actually use the first composite type comparator that you mention:
That comparator can describe all of your schema because of the 'AsciiType' component at the end of your composite. This component of your column names will contain the literal string 'sum' or 'uniques', and the column value will match the type accordingly.
An example using a json style notation: