Certain CQL commands allow a WITH clause for setting certain properties on a keyspace or table. Note that CQL does not currently offer support for using all of the Cassandra table attributes as CQL storage parameters, just a subset.
CQL supports setting the following keyspace properties.
CQL supports Cassandra table attributes through the CQL properties listed in the following table. The table includes the default value of the property. In CQL statements, such as CREATE TABLE, you format properties in either the name-value pair or collection map format.
The name-value pair property syntax is:
name = value AND name = value
The collection map format is:
{ name : value, name, value : name, value ... }
See CREATE TABLE for examples.
| CQL Properties Name | Format |
|---|---|
| bloom_filter_fp_chance | name: value |
| caching | name: value |
| comment | name: value |
| compaction | map |
| compression | map |
| dclocal_read_repair_chance | name: value |
| gc_grace_seconds | name: value |
| read_repair_chance | name: value |
| replicate_on_write | name: value |
Comments can be used to document CQL statements in your application code. Single line comments can begin with a double dash (--) or a double slash (//) and extend to the end of the line. Multi-line comments can be enclosed in /* and */ characters.
Using CQL, you can configure compaction for a table by constructing a map of the compaction property and the following subproperties:
| CQL Compaction Subproperties Name | Supported Strategy |
|---|---|
| bucket_high | SizeTieredCompactionStrategy |
| bucket_low | SizeTieredCompactionStrategy |
| max_threshold | SizeTieredCompactionStrategy |
| min_threshold | SizeTieredCompactionStrategy |
| min_sstable_size | SizeTieredCompactionStrategy |
| sstable_size_in_mb | LeveledCompactionStrategy |
| tombstone_compaction_interval | all |
| tombstone_threshold | all |
Using CQL, you can configure compression for a table by constructing a map of the compression property and the following subproperties:
To query the Cassandra database, use CQL commands described in the next section.