This section gives a quick overview on CQL 3. It is possible that new features get added as Cassandra evolves. Someone experienced working with Thrift API will have a hard time getting their head around the CQL 3 representation. Let's see a couple of changes when going from Thrift API to CQL 3.
Wide rows in Thrift are transposed in CQL 3—columns are treated as rows. So, a wide row in the Thrift world is just a table with three columns, namely key
, which is the row key, column1
, which is the column name in Thrift realm, and a column named value
, which is the value stored in the column. Here is an example:
# Create a wide row column family in Thrift (cassandra-cli) [default@cqltest] CREATE COLUMN FAMILY WideRowThrift WITH KEY_VALIDATION_CLASS = UUIDType AND COMPARATOR = DateType AND DEFAULT_VALIDATION_CLASS = UTF8Type; # Insert some rows [default@cqltest] SET WideRowThrift[fa408aff-a55b-4a52-b4b7-2314bb5bb86f][1374742812] = 'New chat session'; # View...