Author: tylerhobbs
Date: Tue Jul 22 17:10:08 2014
New Revision: 1612612
URL: http://svn.apache.org/r1612612
Log:
Add note about CQL2 removal to CQL2 docs
Modified:
cassandra/site/publish/doc/cql/CQL.html
Modified: cassandra/site/publish/doc/cql/CQL.html
URL:
http://svn.apache.org/viewvc/cassandra/site/publish/doc/cql/CQL.html?rev=1612612&r1=1612611&r2=1612612&view=diff
==============================================================================
--- cassandra/site/publish/doc/cql/CQL.html (original)
+++ cassandra/site/publish/doc/cql/CQL.html Tue Jul 22 17:10:08 2014
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html
xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type"
content="text/html; charset=utf-8"/><title>CQL</title></head><body><p><!-- This
is only a suggestion, to demonstrate that the pre.syntax and pre.sample classes
should probably be rendered differently. Render as you like. --><link
rel="StyleSheet" href="CQL.css" type="text/css" media="screen"></p><h1
id="CassandraQueryLanguageCQLv2.0">Cassandra Query Language (CQL) v2.0</h1><h2
id="TableofContents">Table of Contents</h2><ol style="list-style: none;"><li><a
href="CQL.html#CassandraQueryLanguageCQLv2.0">Cassandra Query Language (CQL)
v2.0</a><ol style="list-style: none;"><li><a
href="CQL.html#TableofContents">Table of Contents</a></li><li><a
href="CQL.html#Syntaxconventions">Syntax conventions</a></li><li><a
href="CQL.html#Overallsyntax">Overall syn
tax</a></li><li><a href="CQL.html#storageTypes">Data Storage Types</a><ol
style="list-style: none;"><li><a href="CQL.html#usingdates">Working with
dates</a></li></ol></li><li><a href="CQL.html#USE">USE</a></li><li><a
href="CQL.html#SELECT">SELECT</a><ol style="list-style: none;"><li><a
href="CQL.html#SpecifyingColumns">Specifying Columns</a></li><li><a
href="CQL.html#ColumnFamily">Column Family</a></li><li><a
href="CQL.html#ConsistencyLevel">Consistency Level</a></li><li><a
href="CQL.html#Filteringrows">Filtering rows</a></li><li><a
href="CQL.html#Limits">Limits</a></li></ol></li><li><a
href="CQL.html#INSERT">INSERT</a></li><li><a
href="CQL.html#update">UPDATE</a><ol style="list-style: none;"><li><a
href="CQL.html#ColumnFamily2">Column Family</a></li><li><a
href="CQL.html#ConsistencyLevel2">Consistency Level</a></li><li><a
href="CQL.html#Timestamp">Timestamp</a></li><li><a
href="CQL.html#TTL">TTL</a></li><li><a
href="CQL.html#SpecifyingColumnsandRow">Specifying Columns and Row</a></
li><li><a href="CQL.html#UpdatingCounterColumns">Updating Counter
Columns</a></li></ol></li><li><a href="CQL.html#DELETE">DELETE</a><ol
style="list-style: none;"><li><a href="CQL.html#SpecifyingColumns2">Specifying
Columns</a></li><li><a href="CQL.html#ColumnFamily3">Column
Family</a></li><li><a href="CQL.html#ConsistencyLevel3">Consistency
Level</a></li><li><a href="CQL.html#deleterows">Specifying
Rows</a></li></ol></li><li><a href="CQL.html#TRUNCATE">TRUNCATE</a></li><li><a
href="CQL.html#BATCH">BATCH</a></li><li><a
href="CQL.html#CREATEKEYSPACE">CREATE KEYSPACE</a></li><li><a
href="CQL.html#CREATECOLUMNFAMILY">CREATE COLUMNFAMILY</a><ol
style="list-style: none;"><li><a href="CQL.html#keytypes">Specifying Key
Type</a></li><li><a href="CQL.html#SpecifyingColumnTypesoptional">Specifying
Column Types (optional)</a></li><li><a
href="CQL.html#ColumnFamilyOptionsoptional">Column Family Options
(optional)</a></li></ol></li><li><a href="CQL.html#CREATEINDEX">CREATE
INDEX</a></li><li><a hr
ef="CQL.html#DROPKEYSPACE">DROP KEYSPACE</a></li><li><a
href="CQL.html#DROPCOLUMNFAMILY">DROP COLUMNFAMILY</a></li><li><a
href="CQL.html#DROPINDEX">DROP INDEX</a></li><li><a
href="CQL.html#ALTERCOLUMNFAMILY">ALTER COLUMNFAMILY</a><ol style="list-style:
none;"><li><a href="CQL.html#Changingthetypeofatypedcolumn">Changing the type
of a typed column</a></li><li><a href="CQL.html#Addingatypedcolumn">Adding a
typed column</a></li><li><a href="CQL.html#Droppingatypedcolumn">Dropping a
typed column</a></li></ol></li><li><a href="CQL.html#CommonIdioms">Common
Idioms</a><ol style="list-style: none;"><li><a
href="CQL.html#consistency">Specifying
Consistency</a></li></ol></li></ol></li><li><a
href="CQL.html#Versioning">Versioning</a></li><li><a
href="CQL.html#Changes">Changes</a></li></ol><h2 id="Syntaxconventions">Syntax
conventions</h2><p>To aid in specifying the CQL syntax, we will use the
following conventions in this document:</p><ul><li>Language rules will be given
in a <acronym title="B
ackus-Naur Form">BNF</acronym>-like notation, looking like this:</li></ul><pre
class="syntax"><pre><Start> ::= <CQL_Statement>*
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html
xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type"
content="text/html; charset=utf-8"/><title>CQL</title></head><body><p><!-- This
is only a suggestion, to demonstrate that the pre.syntax and pre.sample classes
should probably be rendered differently. Render as you like. --><link
rel="StyleSheet" href="CQL.css" type="text/css" media="screen"></p><h1
id="CassandraQueryLanguageCQLv2.0">Cassandra Query Language (CQL)
v2.0</h1><p><b><span style="color:red">NOTICE</span></b>: CQL 2 has been
deprecated since Cassandra 2.0, and will be removed in Cassandra 3.0. It is
recommended that you upgrade to CQL 3, which has much better driver support and
many new features. For further reading, see the <a
href="http://cassandra.apache.org/doc/cql3/CQL.html">CQL 3 documentation</a>
and the <a href="http://wiki.a
pache.org/cassandra/ClientOptions">CQL 3 drivers</a>.</p><h2
id="TableofContents">Table of Contents</h2><ol style="list-style: none;"><li><a
href="CQL.html#CassandraQueryLanguageCQLv2.0">Cassandra Query Language (CQL)
v2.0</a><ol style="list-style: none;"><li><a
href="CQL.html#TableofContents">Table of Contents</a></li><li><a
href="CQL.html#Syntaxconventions">Syntax conventions</a></li><li><a
href="CQL.html#Overallsyntax">Overall syntax</a></li><li><a
href="CQL.html#storageTypes">Data Storage Types</a><ol style="list-style:
none;"><li><a href="CQL.html#usingdates">Working with
dates</a></li></ol></li><li><a href="CQL.html#USE">USE</a></li><li><a
href="CQL.html#SELECT">SELECT</a><ol style="list-style: none;"><li><a
href="CQL.html#SpecifyingColumns">Specifying Columns</a></li><li><a
href="CQL.html#ColumnFamily">Column Family</a></li><li><a
href="CQL.html#ConsistencyLevel">Consistency Level</a></li><li><a
href="CQL.html#Filteringrows">Filtering rows</a></li><li><a
href="CQL.html#Limits
">Limits</a></li></ol></li><li><a href="CQL.html#INSERT">INSERT</a></li><li><a
href="CQL.html#update">UPDATE</a><ol style="list-style: none;"><li><a
href="CQL.html#ColumnFamily2">Column Family</a></li><li><a
href="CQL.html#ConsistencyLevel2">Consistency Level</a></li><li><a
href="CQL.html#Timestamp">Timestamp</a></li><li><a
href="CQL.html#TTL">TTL</a></li><li><a
href="CQL.html#SpecifyingColumnsandRow">Specifying Columns and
Row</a></li><li><a href="CQL.html#UpdatingCounterColumns">Updating Counter
Columns</a></li></ol></li><li><a href="CQL.html#DELETE">DELETE</a><ol
style="list-style: none;"><li><a href="CQL.html#SpecifyingColumns2">Specifying
Columns</a></li><li><a href="CQL.html#ColumnFamily3">Column
Family</a></li><li><a href="CQL.html#ConsistencyLevel3">Consistency
Level</a></li><li><a href="CQL.html#deleterows">Specifying
Rows</a></li></ol></li><li><a href="CQL.html#TRUNCATE">TRUNCATE</a></li><li><a
href="CQL.html#BATCH">BATCH</a></li><li><a href="CQL.html#CREATEKEYSPACE">CREAT
E KEYSPACE</a></li><li><a href="CQL.html#CREATECOLUMNFAMILY">CREATE
COLUMNFAMILY</a><ol style="list-style: none;"><li><a
href="CQL.html#keytypes">Specifying Key Type</a></li><li><a
href="CQL.html#SpecifyingColumnTypesoptional">Specifying Column Types
(optional)</a></li><li><a href="CQL.html#cfopts">Column Family Options
(optional)</a></li></ol></li><li><a href="CQL.html#CREATEINDEX">CREATE
INDEX</a></li><li><a href="CQL.html#DROPKEYSPACE">DROP KEYSPACE</a></li><li><a
href="CQL.html#DROPCOLUMNFAMILY">DROP COLUMNFAMILY</a></li><li><a
href="CQL.html#DROPINDEX">DROP INDEX</a></li><li><a
href="CQL.html#ALTERCOLUMNFAMILY">ALTER COLUMNFAMILY</a><ol style="list-style:
none;"><li><a href="CQL.html#Changingthetypeofatypedcolumn">Changing the type
of a typed column</a></li><li><a href="CQL.html#Addingatypedcolumn">Adding a
typed column</a></li><li><a href="CQL.html#Droppingatypedcolumn">Dropping a
typed column</a></li><li><a
href="CQL.html#Modifyingcolumnfamilyproperties">Modifying column fami
ly properties</a></li></ol></li><li><a href="CQL.html#CommonIdioms">Common
Idioms</a><ol style="list-style: none;"><li><a
href="CQL.html#consistency">Specifying
Consistency</a></li></ol></li></ol></li><li><a
href="CQL.html#Versioning">Versioning</a></li><li><a
href="CQL.html#Changes">Changes</a></li></ol><h2 id="Syntaxconventions">Syntax
conventions</h2><p>To aid in specifying the CQL syntax, we will use the
following conventions in this document:</p><ul><li>Language rules will be given
in a <acronym title="Backus-Naur Form">BNF</acronym>-like notation, looking
like this:</li></ul><pre class="syntax"><pre><Start> ::= <CQL_Statement>*
;
</pre></pre><ul><li>Nonterminal symbols in syntax rules will have
<code><angle brackets></code>.</li><li>Terminal symbols will be shown in
<code>"single quotes"</code>.</li><li>As an additional shortcut notation to
BNF, optional symbols (that can occur zero or one times) will be followed by a
<code>?</code> marker. Optional symbols that can occur zero or any number of
times will be followed by a <code>*</code> marker. Multiple symbols may be
grouped together in <code>(parentheses)</code> to signify that they are all
optional or repeatable together.</li><li>In a few cases where meaning is more
easily conveyed through prose, we explain a symbol and its expansion without
BNF.</li><li>Sample code will also be shown in a code block:</li></ul><pre
class="sample"><pre>SELECT sample_usage FROM cql;
</pre></pre><ul><li>References to keywords or pieces of CQL code in running
text will be shown in a <code>fixed-width font</code>.</li></ul><h2
id="Overallsyntax">Overall syntax</h2><p>CQL consists of statements. As in SQL,
some statements directly make changes to data, some look up data, and some
change the way data is stored.</p><p>All statements end with a
semicolon.</p><pre class="syntax"><pre><CQL_Statement> ::=
<statementBody> ";"
@@ -175,16 +175,14 @@ CREATE KEYSPACE Excalibur WITH strategy_
</pre></pre><p>The <code>CREATE KEYSPACE</code> statement creates a new
top-level namespace (aka “keyspace”). Valid names are any string
constructed of alphanumeric characters and underscores. Names which do not work
as valid identifiers or integers should be quoted as string literals.
Properties such as replication strategy and count are specified during creation
using the following accepted keyword
arguments:</p><table><tr><th>keyword</th><th>required</th><th>description</th></tr><tr><td>strategy_class</td><td>yes</td><td>The
name of the replication strategy class which should be used for the new
keyspace. Some often-used classes are <code>SimpleStrategy</code> and
<code>NetworkTopologyStrategy</code>.</td></tr><tr><td>strategy_options</td><td>no</td><td>Most
strategies require additional arguments which can be supplied by appending the
option name to the <code>strategy_options</code> keyword, separated by a colon
(<code>:</code>). For example, a strategy option of &#
8220;DC1” with a value of “1” would be specified as
<code>strategy_options:DC1 = 1</code>; replication_factor for SimpleStrategy
could be
<code>strategy_options:replication_factor=3</code>.</td></tr></table><h2
id="CREATECOLUMNFAMILY">CREATE COLUMNFAMILY</h2><p><i>Syntax:</i></p><pre
class="syntax"><pre><createColumnFamilyStatement> ::= "CREATE"
"COLUMNFAMILY" <name>
"(" <term> <storageType> "PRIMARY"
"KEY"
( "," <term> <storageType> )* ")"
- ( "WITH" <identifier> "="
<cfOptionVal>
- ( "AND" <identifier> "="
<cfOptionVal> )* )?
+ ( "WITH" <optionName> "="
<cfOptionVal>
+ ( "AND" <optionName> "="
<cfOptionVal> )* )?
;
-<cfOptionVal> ::= <storageType>
- | <identifier>
- | <stringLiteral>
- | <integer>
- | <float>
- ;
-</pre></pre><p><i>Sample:</i></p><pre class="sample"><pre>CREATE COLUMNFAMILY
Fish (KEY blob PRIMARY KEY);
+<optionName> ::= <identifier>
+ | <optionName> ":" <identifier>
+ | <optionName> ":" <integer>
+ ;
+</pre></pre><p><cfOptionVal> ::= <storageType><br/> |
<identifier><br/> | <stringLiteral><br/> |
<integer><br/> | <float><br/>
;</p><p><i>Sample:</i></p><pre class="sample"><pre>CREATE COLUMNFAMILY Fish
(KEY blob PRIMARY KEY);
CREATE COLUMNFAMILY FastFoodEatings (user text PRIMARY KEY)
WITH comparator=timestamp AND default_validation=int;
CREATE COLUMNFAMILY MonkeyTypes (
@@ -196,8 +194,8 @@ CREATE COLUMNFAMILY MonkeyTypes (
AND read_repair_chance = 1.0;
</pre></pre><p><code>CREATE COLUMNFAMILY</code> 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.</p><h3 id="keytypes">Specifying Key Type</h3><pre
class="sample"><pre>CREATE ... (KEY ascii PRIMARY KEY, ... ) ...
</pre></pre><p>When creating a new column family, you must specify the key
type. The list of possible types is identical to column comparators/validators
(see <a href="#storageTypes">Data Storage Types</a>), except it probably does
not make sense to use <code>counter</code> for a key. It’s important to
note that the key type you use must be compatible with the partitioner in use.
For example, <code>OrderPreservingPartitioner</code> and
<code>CollatingOrderPreservingPartitioner</code> both require UTF-8 keys. If
you use an identifier for the primary key name, instead of the <code>KEY</code>
keyword, a key alias will be set automatically.</p><h3
id="SpecifyingColumnTypesoptional">Specifying Column Types (optional)</h3><pre
class="sample"><pre>CREATE ... ( ... , name1 type1, name2 type2, ... ) ...
-</pre></pre><p>It is possible to assign columns a type during column family
creation. Columns configured with a type are validated accordingly when a write
occurs, and intelligent CQL drivers and interfaces will be able to decode the
column values correctly when receiving them. Column types are specified as a
parenthesized, comma-separated list of column term and type pairs. See <a
href="#storageTypes">Data Storage Types</a> for the list of recognized
types.</p><h3 id="ColumnFamilyOptionsoptional">Column Family Options
(optional)</h3><pre class="sample"><pre>CREATE COLUMNFAMILY ... WITH keyword1 =
arg1 AND keyword2 = arg2;
-</pre></pre><p>A number of optional keyword arguments can be supplied to
control the configuration of a new column
family.</p><table><tr><th>keyword</th><th>default</th><th>description</th></tr><tr><td>comparator</td><td>text</td><td>Determines
the storage type of column names (which itself determines the sorting and
validation of column names). Valid values are listed in the <a
href="#storageTypes">Data Storage Types</a> table
above.</td></tr><tr><td>comment</td><td>none</td><td>A free-form,
human-readable
comment.</td></tr><tr><td>row_cache_provider</td><td>SerializingCacheProvider
if JNA is present, otherwise ConcurrentHashMapCacheProvider</td><td>A factory
for the cache with which to back the row
cache.</td></tr><tr><td>row_cache_size</td><td>0</td><td>Number of rows whose
entire contents to cache in
memory.</td></tr><tr><td>key_cache_size</td><td>200000</td><td>Number of keys
per SSTable whose locations are kept in memory in “mostly LRU”
order.</td></tr><tr><td>read
_repair_chance</td><td>1.0</td><td>The probability with which read repairs
should be invoked on non-quorum
reads.</td></tr><tr><td>gc_grace_seconds</td><td>864000</td><td>Time to wait
before garbage collecting tombstones (deletion
markers).</td></tr><tr><td>default_validation</td><td>text</td><td>Determines
the default storage type of column values (which itself determines the
validation for column values). This option does not affect the types of columns
which were defined in a <code>CREATE COLUMNFAMILY</code> statement— only
new columns. Valid values are listed in the <a href="#storageTypes">Data
Storage Types</a> table
above.</td></tr><tr><td>min_compaction_threshold</td><td>4</td><td>Minimum
number of SSTables needed to start a minor
compaction.</td></tr><tr><td>max_compaction_threshold</td><td>32</td><td>Maximum
number of SSTables allowed before a minor compaction is
forced.</td></tr><tr><td>row_cache_save_period_in_seconds</td><td>0</td><td>Number
of seconds between savi
ng row
caches.</td></tr><tr><td>key_cache_save_period_in_seconds</td><td>14400</td><td>Number
of seconds between saving key
caches.</td></tr><tr><td>replicate_on_write</td><td>false</td><td></td></tr></table><h2
id="CREATEINDEX">CREATE INDEX</h2><p><i>Syntax:</i></p><pre
class="syntax"><pre><createIndexStatement> ::= "CREATE" "INDEX"
<identifier>? "ON"
+</pre></pre><p>It is possible to assign columns a type during column family
creation. Columns configured with a type are validated accordingly when a write
occurs, and intelligent CQL drivers and interfaces will be able to decode the
column values correctly when receiving them. Column types are specified as a
parenthesized, comma-separated list of column term and type pairs. See <a
href="#storageTypes">Data Storage Types</a> for the list of recognized
types.</p><h3 id="cfopts">Column Family Options (optional)</h3><pre
class="sample"><pre>CREATE COLUMNFAMILY ... WITH keyword1 = arg1 AND keyword2 =
arg2;
+</pre></pre><p>A number of optional keyword arguments can be supplied to
control the configuration of a new column
family.</p><table><tr><th>keyword</th><th>default</th><th>description</th></tr><tr><td>comparator</td><td>text</td><td>Determines
the storage type of column names (which itself determines the sorting and
validation of column names). Valid values are listed in the <a
href="#storageTypes">Data Storage Types</a> table
above.</td></tr><tr><td>comment</td><td>none</td><td>A free-form,
human-readable
comment.</td></tr><tr><td>read_repair_chance</td><td>1.0</td><td>The
probability with which read repairs should be invoked on non-quorum
reads.</td></tr><tr><td>gc_grace_seconds</td><td>864000</td><td>Time to wait
before garbage collecting tombstones (deletion
markers).</td></tr><tr><td>default_validation</td><td>text</td><td>Determines
the default storage type of column values (which itself determines the
validation for column values). This option does not affect the types of co
lumns which were defined in a <code>CREATE COLUMNFAMILY</code>
statement— only new columns. Valid values are listed in the <a
href="#storageTypes">Data Storage Types</a> table
above.</td></tr><tr><td>min_compaction_threshold</td><td>4</td><td>Minimum
number of SSTables needed to start a minor
compaction.</td></tr><tr><td>max_compaction_threshold</td><td>32</td><td>Maximum
number of SSTables allowed before a minor compaction is
forced.</td></tr><tr><td>replicate_on_write</td><td>false</td><td></td></tr><tr><td>compaction_strategy_options</td><td>none</td><td>CompactionStrategy
specific options such as “sstable_size_in_mb” for
LeveledCompactionStrategy and “min_sstable_size” for
SizeTieredCompactionStrategy</td></tr><tr><td>compression_parameters</td><td>none</td><td>Compression
parameters such as “sstable_compressor” and
"chunk_length_kb"</td></tr></table><h2 id="CREATEINDEX">CREATE
INDEX</h2><p><i>Syntax:</i></p><pre class="syntax"><pre><
createIndexStatement> ::= "CREATE" "INDEX" <identifier>? "ON"
<name> "(" <term> ")"
;
</pre></pre><p><i>Sample:</i></p><pre class="sample"><pre>CREATE INDEX
userIndex ON NerdMovies (user);
@@ -216,11 +214,14 @@ CREATE INDEX ON Mutants (abilityId);
<alterInstructions> ::= "ALTER" <name> "TYPE" <storageType>
| "ADD" <name> <storageType>
| "DROP" <name>
+ | "WITH" <optionName> "=" <cfOptionVal>
+ ( "AND" <optionName> "=" <cfOptionVal> )*
;
-</pre></pre><p>An <code>ALTER</code> statement is used to manipulate column
family column metadata. It allows you to add new columns, drop existing
columns, or change the data storage type of existing columns. No results are
returned.</p><p>Specify the name of the column family to be changed after the
<code>ALTER COLUMNFAMILY</code> keywords, and the name of the column to be
changed, added, or dropped after the keyword corresponding to the type of
change desired (<code>ALTER</code>, <code>ADD</code>,
<code>DROP</code>).</p><h3 id="Changingthetypeofatypedcolumn">Changing the type
of a typed column</h3><pre class="sample"><pre>ALTER COLUMNFAMILY addamsFamily
ALTER lastKnownLocation TYPE uuid;
-</pre></pre><p><code>ALTER COLUMNFAMILY ... ALTER</code> changes the expected
storage type for a column. The column must already have a type in the column
family metadata. The column may or may not already exist in current rows—
but be aware that no validation of existing data is done. The bytes stored in
values for that column will remain unchanged, and if existing data is not
deserializable according to the new type, this may cause your CQL driver or
interface to report errors.</p><h3 id="Addingatypedcolumn">Adding a typed
column</h3><pre class="sample"><pre>ALTER COLUMNFAMILY addamsFamily ADD
gravesite varchar;
+</pre></pre><p>An <code>ALTER</code> statement is used to manipulate column
family column metadata. It allows you to add new columns, drop existing
columns, data storage type of existing columns, or change the column family
properties. No results are returned.</p><p>Specify the name of the column
family to be changed after the <code>ALTER COLUMNFAMILY</code> keywords,
followed by the type of change desired (<code>ALTER</code>, <code>ADD</code>,
<code>DROP</code>, or <code>WITH</code>), and provide the rest of the needed
information, as explained below.</p><h3
id="Changingthetypeofatypedcolumn">Changing the type of a typed column</h3><pre
class="sample"><pre>ALTER COLUMNFAMILY addamsFamily ALTER lastKnownLocation
TYPE uuid;
+</pre></pre><p><code>ALTER COLUMNFAMILY ... ALTER</code> changes the expected
storage type for a column. The column must either be the key alias or already
have a type in the column family metadata. The column may or may not already
exist in current rows— but be aware that no validation of existing data
is done. The bytes stored in values for that column will remain unchanged, and
if existing data is not deserializable according to the new type, this may
cause your CQL driver or interface to report errors.</p><h3
id="Addingatypedcolumn">Adding a typed column</h3><pre
class="sample"><pre>ALTER COLUMNFAMILY addamsFamily ADD gravesite varchar;
</pre></pre><p>The <code>ALTER COLUMNFAMILY ... ADD</code> variant adds a
typed column to a column family. The column must not already have a type in the
column family metadata. The same warnings from the above <code>ALTER</code>
section, about there being no validation of existing data, apply here as
well.</p><h3 id="Droppingatypedcolumn">Dropping a typed column</h3><pre
class="sample"><pre>ALTER COLUMNFAMILY addamsFamily DROP gender;
-</pre></pre><p>An <code>ALTER COLUMNFAMILY ... DROP</code> statement removes
the type of a column from the column family metadata. Note that this does
<em>not</em> remove the column from current rows; it just removes the metadata
saying that the bytes stored under that column are expected to be
deserializable according to a certain type.</p><h2 id="CommonIdioms">Common
Idioms</h2><h3 id="consistency">Specifying Consistency</h3><pre
class="syntax"><pre><consistency> ::= "ANY"
+</pre></pre><p>An <code>ALTER COLUMNFAMILY ... DROP</code> statement removes
the type of a column from the column family metadata. Note that this does
<em>not</em> remove the column from current rows; it just removes the metadata
saying that the bytes stored under that column are expected to be
deserializable according to a certain type.</p><h3
id="Modifyingcolumnfamilyproperties">Modifying column family
properties</h3><pre class="sample"><pre>ALTER COLUMNFAMILY addamsFamily WITH
comment = 'A most excellent and useful column family' AND read_repair_chance =
0.2;
+</pre></pre><p>An <code>ALTER COLUMNFAMILY ... WITH</code> statement makes
adjustments to the column family properties, as defined when the column family
was created (see <a href="#cfopts">CREATE COLUMNFAMILY options</a> for
information about the supported options and values).</p><p>Note that setting
any <code>compaction_strategy_options:*</code> parameters has the effect of
erasing all previous <code>compaction_strategy_options:*</code> parameters, so
you will need to re-specify any such parameters which have already been set, if
you want to keep them. The same note applies to the set of
<code>compression_parameters:*</code> parameters.</p><h2
id="CommonIdioms">Common Idioms</h2><h3 id="consistency">Specifying
Consistency</h3><pre class="syntax"><pre><consistency> ::= "ANY"
| "ONE"
| "QUORUM"
| "ALL"