diff --git a/doc/cql/CQL.html b/doc/cql/CQL.html index 1f24af803a..21a808181b 100644 --- a/doc/cql/CQL.html +++ b/doc/cql/CQL.html @@ -33,10 +33,10 @@ CREATE COLUMNFAMILY <COLUMN FAMILY> (KEY <type> PRIMARY KEY [, name1 [WITH keyword1 = arg1 [AND keyword2 = arg2 [AND ...]]];
CREATE COLUMNFAMILY statements create new column family namespaces under the current keyspace. Valid column family names are strings of alphanumeric characters and underscores, which begin with a letter.
CREATE ... (KEY <type> PRIMARY KEY) ...
When creating a new column family, you must specify key type. The list of possible key types is identical to column comparators/validators, (see Specifying Column Type). It’s important to note that the key type must be compatible with the partitioner in use, for example OrderPreservingPartitioner and CollatingOrderPreservingPartitioner both require UTF-8 keys.
CREATE ... (KEY <type> PRIMARY KEY, name1 type, name2 type) ...
-It is possible to assign columns a type during column family creation. Columns configured with a type are validated accordingly when a write occurs. Column types are specified as a parenthesized, comma-separated list of column term and type pairs. The list of recognized types are:
| type | description |
|---|---|
| bytes | Arbitrary bytes (no validation) |
| ascii | ASCII character string |
| utf8 | UTF8 encoded string |
| timeuuid | Type 1 UUID |
| uuid | Type 4 UUID |
| int | 4-byte integer |
| long | 8-byte long |
Note: In addition to the recognized types listed above, it is also possible to supply a string containing the name of a class (a sub-class of AbstractType), either fully qualified, or relative to the org.apache.cassandra.db.marshal package.
CREATE COLUMNFAMILY ... WITH keyword1 = arg1 AND keyword2 = arg2;
-A number of optional keyword arguments can be supplied to control the configuration of a new column family.
| keyword | default | description |
|---|---|---|
| comparator | utf8 | Determines sorting and validation of column names. Valid values are identical to the types listed in Specifying Column Type above. |
| comment | none | A free-form, human-readable comment. |
| row_cache_size | 0 | Number of rows whose entire contents to cache in memory. |
| key_cache_size | 200000 | Number of keys per SSTable whose locations are kept in memory in “mostly LRU” order. |
| read_repair_chance | 1.0 | The probability with which read repairs should be invoked on non-quorum reads. |
| gc_grace_seconds | 864000 | Time to wait before garbage collecting tombstones (deletion markers). |
| default_validation | utf8 | Determines validation of column values. Valid values are identical to the types listed in Specifying Column Type above. |
| min_compaction_threshold | 4 | Minimum number of SSTables needed to start a minor compaction. |
| max_compaction_threshold | 32 | Maximum number of SSTables allowed before a minor compaction is forced. |
| row_cache_save_period_in_seconds | 0 | Number of seconds between saving row caches. |
| key_cache_save_period_in_seconds | 14400 | Number of seconds between saving key caches. |
| memtable_flush_after_mins | 60 | Maximum time to leave a dirty table unflushed. |
| memtable_throughput_in_mb | dynamic | Maximum size of the memtable before it is flushed. |
| memtable_operations_in_millions | dynamic | Number of operations in millions before the memtable is flushed. |
| replicate_on_write | false |
Synopsis:
CREATE INDEX [index_name] ON <column_family> (column_name);
+It is possible to assign columns a type during column family creation. Columns configured with a type are validated accordingly when a write occurs. Column types are specified as a parenthesized, comma-separated list of column term and type pairs. The list of recognized types are:
| type | description |
|---|---|
| bytea | Arbitrary bytes (no validation) |
| ascii | ASCII character string |
| text | UTF8 encoded string |
| varchar | UTF8 encoded string |
| uuid | Type 1, or type 4 UUID |
| varint | 4-byte integer |
| bigint | 8-byte long |
Note: In addition to the recognized types listed above, it is also possible to supply a string containing the name of a class (a sub-class of AbstractType), either fully qualified, or relative to the org.apache.cassandra.db.marshal package.
CREATE COLUMNFAMILY ... WITH keyword1 = arg1 AND keyword2 = arg2;
+A number of optional keyword arguments can be supplied to control the configuration of a new column family.
| keyword | default | description |
|---|---|---|
| comparator | text | Determines sorting and validation of column names. Valid values are identical to the types listed in Specifying Column Type above. |
| comment | none | A free-form, human-readable comment. |
| row_cache_size | 0 | Number of rows whose entire contents to cache in memory. |
| key_cache_size | 200000 | Number of keys per SSTable whose locations are kept in memory in “mostly LRU” order. |
| read_repair_chance | 1.0 | The probability with which read repairs should be invoked on non-quorum reads. |
| gc_grace_seconds | 864000 | Time to wait before garbage collecting tombstones (deletion markers). |
| default_validation | text | Determines validation of column values. Valid values are identical to the types listed in Specifying Column Type above. |
| min_compaction_threshold | 4 | Minimum number of SSTables needed to start a minor compaction. |
| max_compaction_threshold | 32 | Maximum number of SSTables allowed before a minor compaction is forced. |
| row_cache_save_period_in_seconds | 0 | Number of seconds between saving row caches. |
| key_cache_save_period_in_seconds | 14400 | Number of seconds between saving key caches. |
| memtable_flush_after_mins | 60 | Maximum time to leave a dirty table unflushed. |
| memtable_throughput_in_mb | dynamic | Maximum size of the memtable before it is flushed. |
| memtable_operations_in_millions | dynamic | Number of operations in millions before the memtable is flushed. |
| replicate_on_write | false |
Synopsis:
CREATE INDEX [index_name] ON <column_family> (column_name);
A CREATE INDEX statement is used to create a new, automatic secondary index for the named column.
Synopsis:
DROP <KEYSPACE|COLUMNFAMILY> namespace;
DROP statements result in the immediate, irreversible removal of keyspace and column family namespaces.
... USING <CONSISTENCY> ...
-Consistency level specifications are made up the keyword USING, followed by a consistency level identifier. Valid consistency levels are as follows:
CONSISTENCY ZEROCONSISTENCY ONE (default)CONSISTENCY QUORUMCONSISTENCY ALLCONSISTENCY DCQUORUMCONSISTENCY DCQUORUMSYNCTerms are used in statements to specify things such as keyspaces, column families, indexes, column names and values, and keyword arguments. The rules governing term specification are as follows:
'apple').carrot).100).1438fc5c-4ff6-11e0-b97f-0026c650d722). Terms which do not conform to these rules result in an exception.
How column name/value terms are interpreted is determined by the configured type.
| type | term |
|---|---|
| ascii | Any string which can be decoded using ASCII charset |
| utf8 | Any string which can be decoded using UTF8 charset |
| uuid | Standard UUID string format (hyphen-delimited hex notation) |
| timeuuid | Standard UUID string format (hyphen-delimited hex notation) |
| timeuuid | The string now, to represent a type-1 (time-based) UUID with a date-time component based on the current time |
| timeuuid | Numeric value representing milliseconds since epoch |
| timeuuid | An iso8601 timestamp |
| long | Numeric value capable of fitting in 8 bytes |
| int | Numeric value of arbitrary size |
| bytes | Hex-encoded strings (converted directly to the corresponding bytes) |
Versioning of the CQL language adheres to the Semantic Versioning guidelines. Versions take the form X.Y.Z where X, Y, and Z are integer values representing major, minor, and patch level respectively. There is no correlation between Cassandra release versions and the CQL language version.
| version | description |
|---|---|
| Patch | The patch version is incremented when bugs are fixed. |
| Minor | Minor version increments occur when new, but backward compatible, functionality is introduced. |
| Major | The major version must be bumped when backward incompatible changes are introduced. This should rarely (if ever) occur. |
Tue, 22 Mar 2011 18:10:28 -0700 - Eric Evans <eevans@rackspace.com> +
Consistency level specifications are made up the keyword USING, followed by a consistency level identifier. Valid consistency levels are as follows:
CONSISTENCY ZEROCONSISTENCY ONE (default)CONSISTENCY QUORUMCONSISTENCY ALLCONSISTENCY DCQUORUMCONSISTENCY DCQUORUMSYNCTerms are used in statements to specify things such as keyspaces, column families, indexes, column names and values, and keyword arguments. The rules governing term specification are as follows:
'apple').carrot).100).1438fc5c-4ff6-11e0-b97f-0026c650d722). Terms which do not conform to these rules result in an exception.
How column name/value terms are interpreted is determined by the configured type.
| type | term |
|---|---|
| ascii | Any string which can be decoded using ASCII charset |
| text / varchar | Any string which can be decoded using UTF8 charset |
| uuid | Standard UUID string format (hyphen-delimited hex notation) |
| uuid | Standard UUID string format (hyphen-delimited hex notation) |
| uuid | The string now, to represent a type-1 (time-based) UUID with a date-time component based on the current time |
| uuid | Numeric value representing milliseconds since epoch |
| uuid | An iso8601 timestamp |
| bigint | Numeric value capable of fitting in 8 bytes |
| varint | Numeric value of arbitrary size |
| bytea | Hex-encoded strings (converted directly to the corresponding bytes) |
Versioning of the CQL language adheres to the Semantic Versioning guidelines. Versions take the form X.Y.Z where X, Y, and Z are integer values representing major, minor, and patch level respectively. There is no correlation between Cassandra release versions and the CQL language version.
| version | description |
|---|---|
| Patch | The patch version is incremented when bugs are fixed. |
| Minor | Minor version increments occur when new, but backward compatible, functionality is introduced. |
| Major | The major version must be bumped when backward incompatible changes are introduced. This should rarely (if ever) occur. |
Tue, 22 Mar 2011 18:10:28 -0700 - Eric Evans <eevans@rackspace.com> * Initial version, 1.0.0