Database Reference
In-Depth Information
password text
) WITH comment='Users information'
Listing 4.6
demonstrates creating a dynamic table in CQL 3 with an optional
composite partition key.
Listing 4.6
Example Usage of
CREATE TABLE
for a Dynamic Table
CREATE TABLE events (
event_time timestamp,
url text,
event_id uuid,
network_location inet,
event_data text
PRIMARY KEY ((url, event_time), event_id, net-
work_location)
) WITH compaction = { 'class' : 'LeveledCompac-
tionStrategy' }
AND comment='Event Data'
Other Options
The
CREATE TABLE
syntax allows for other options to be set. These options are
purely optional and are defined as key/value pairs in a
WITH
statement after the
column definition. Specifying
WITH COMPACT STORAGE
will create a legacy
table that will allow you to use your existing Thrift-created tables with CQL 3.
The available options are specified in
Table 4.2
.