You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ty...@apache.org on 2015/05/19 18:42:13 UTC

svn commit: r1680340 - /cassandra/site/publish/doc/cql3/CQL-2.2.html

Author: tylerhobbs
Date: Tue May 19 16:42:12 2015
New Revision: 1680340

URL: http://svn.apache.org/r1680340
Log:
Fix links in CQL-2.2.html

Modified:
    cassandra/site/publish/doc/cql3/CQL-2.2.html

Modified: cassandra/site/publish/doc/cql3/CQL-2.2.html
URL: http://svn.apache.org/viewvc/cassandra/site/publish/doc/cql3/CQL-2.2.html?rev=1680340&r1=1680339&r2=1680340&view=diff
==============================================================================
--- cassandra/site/publish/doc/cql3/CQL-2.2.html (original)
+++ cassandra/site/publish/doc/cql3/CQL-2.2.html Tue May 19 16:42:12 2015
@@ -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><link rel="StyleSheet" href="CQL.css" type="text/css" media="screen"></p><h1 id="CassandraQueryLanguageCQLv3.3.0">Cassandra Query Language (CQL) v3.3.0</h1><span id="tableOfContents"><ol style="list-style: none;"><li><a href="CQL.html#CassandraQueryLanguageCQLv3.3.0">Cassandra Query Language (CQL) v3.3.0</a><ol style="list-style: none;"><li><a href="CQL.html#CQLSyntax">CQL Syntax</a><ol style="list-style: none;"><li><a href="CQL.html#Preamble">Preamble</a></li><li><a href="CQL.html#Conventions">Conventions</a></li><li><a href="CQL.html#identifiers">Identifiers and keywords</a></li><li><a href="CQL.html#constants">Constants</a></li><li><a href="CQL.html#Comments">Comments</a></l
 i><li><a href="CQL.html#statements">Statements</a></li><li><a href="CQL.html#preparedStatement">Prepared Statement</a></li></ol></li><li><a href="CQL.html#dataDefinition">Data Definition</a><ol style="list-style: none;"><li><a href="CQL.html#createKeyspaceStmt">CREATE KEYSPACE</a></li><li><a href="CQL.html#useStmt">USE</a></li><li><a href="CQL.html#alterKeyspaceStmt">ALTER KEYSPACE</a></li><li><a href="CQL.html#dropKeyspaceStmt">DROP KEYSPACE</a></li><li><a href="CQL.html#createTableStmt">CREATE TABLE</a></li><li><a href="CQL.html#alterTableStmt">ALTER TABLE</a></li><li><a href="CQL.html#dropTableStmt">DROP TABLE</a></li><li><a href="CQL.html#truncateStmt">TRUNCATE</a></li><li><a href="CQL.html#createIndexStmt">CREATE INDEX</a></li><li><a href="CQL.html#dropIndexStmt">DROP INDEX</a></li><li><a href="CQL.html#createTypeStmt">CREATE TYPE</a></li><li><a href="CQL.html#alterTypeStmt">ALTER TYPE</a></li><li><a href="CQL.html#dropTypeStmt">DROP TYPE</a></li><li><a href="CQL.html#createTri
 ggerStmt">CREATE TRIGGER</a></li><li><a href="CQL.html#dropTriggerStmt">DROP TRIGGER</a></li><li><a href="CQL.html#createFunctionStmt">CREATE FUNCTION</a></li><li><a href="CQL.html#dropFunctionStmt">DROP FUNCTION</a></li><li><a href="CQL.html#createAggregateStmt">CREATE AGGREGATE</a></li><li><a href="CQL.html#dropAggregateStmt">DROP AGGREGATE</a></li></ol></li><li><a href="CQL.html#dataManipulation">Data Manipulation</a><ol style="list-style: none;"><li><a href="CQL.html#insertStmt">INSERT</a></li><li><a href="CQL.html#updateStmt">UPDATE</a></li><li><a href="CQL.html#deleteStmt">DELETE</a></li><li><a href="CQL.html#batchStmt">BATCH</a></li></ol></li><li><a href="CQL.html#queries">Queries</a><ol style="list-style: none;"><li><a href="CQL.html#selectStmt">SELECT</a></li></ol></li><li><a href="CQL.html#types">Data Types</a><ol style="list-style: none;"><li><a href="CQL.html#usingtimestamps">Working with timestamps</a></li><li><a href="CQL.html#usingdates">Working with dates</a></li><li
 ><a href="CQL.html#usingtime">Working with time</a></li><li><a href="CQL.html#counters">Counters</a></li><li><a href="CQL.html#collections">Working with collections</a></li></ol></li><li><a href="CQL.html#functions">Functions</a><ol style="list-style: none;"><li><a href="CQL.html#tokenFun">Token</a></li><li><a href="CQL.html#uuidFun">Uuid</a></li><li><a href="CQL.html#timeuuidFun">Timeuuid functions</a></li><li><a href="CQL.html#blobFun">Blob conversion functions</a></li></ol></li><li><a href="CQL.html#udfs">User-Defined Functions</a></li><li><a href="CQL.html#udas">User-Defined Aggregates</a></li><li><a href="CQL.html#json">JSON Support</a><ol style="list-style: none;"><li><a href="CQL.html#selectJson">SELECT JSON</a></li><li><a href="CQL.html#insertJson">INSERT JSON</a></li><li><a href="CQL.html#jsonEncoding">JSON Encoding of Cassandra Data Types</a></li><li><a href="CQL.html#fromJson">The fromJson() Function</a></li><li><a href="CQL.html#toJson">The toJson() Function</a></li></ol
 ></li><li><a href="CQL.html#appendixA">Appendix A: CQL Keywords</a></li><li><a href="CQL.html#appendixB">Appendix B: CQL Reserved Types</a></li><li><a href="CQL.html#changes">Changes</a><ol style="list-style: none;"><li><a href="CQL.html#a3.3.0">3.3.0</a></li><li><a href="CQL.html#a3.2.0">3.2.0</a></li><li><a href="CQL.html#a3.1.7">3.1.7</a></li><li><a href="CQL.html#a3.1.6">3.1.6</a></li><li><a href="CQL.html#a3.1.5">3.1.5</a></li><li><a href="CQL.html#a3.1.4">3.1.4</a></li><li><a href="CQL.html#a3.1.3">3.1.3</a></li><li><a href="CQL.html#a3.1.2">3.1.2</a></li><li><a href="CQL.html#a3.1.1">3.1.1</a></li><li><a href="CQL.html#a3.1.0">3.1.0</a></li><li><a href="CQL.html#a3.0.5">3.0.5</a></li><li><a href="CQL.html#a3.0.4">3.0.4</a></li><li><a href="CQL.html#a3.0.3">3.0.3</a></li><li><a href="CQL.html#a3.0.2">3.0.2</a></li><li><a href="CQL.html#a3.0.1">3.0.1</a></li></ol></li><li><a href="CQL.html#Versioning">Versioning</a></li></ol></li></ol></span><h2 id="CQLSyntax">CQL Syntax</h2><h
 3 id="Preamble">Preamble</h3><p>This document describes the Cassandra Query Language (CQL) version 3. CQL v3 is not backward compatible with CQL v2 and differs from it in numerous ways. Note that this document describes the last version of the languages. However, the <a href="#changes">changes</a> section provides the diff between the different versions of CQL v3.</p><p>CQL v3 offers a model very close to SQL in the sense that data is put in <em>tables</em> containing <em>rows</em> of <em>columns</em>. For that reason, when used in this document, these terms (tables, rows and columns) have the same definition than they have in SQL. But please note that as such, they do <strong>not</strong> refer to the concept of rows and columns found in the internal implementation of Cassandra and in the thrift and CQL v2 API.</p><h3 id="Conventions">Conventions</h3><p>To aid in specifying the CQL syntax, we will use the following conventions in this document:</p><ul><li>Language rules will be giv
 en in a <a href="http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form">BNF</a> -like notation:</li></ul><pre class="syntax"><pre>&lt;start> ::= TERMINAL &lt;non-terminal1> &lt;non-terminal1>
+<?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-2.2</title></head><body><p><link rel="StyleSheet" href="CQL.css" type="text/css" media="screen"></p><h1 id="CassandraQueryLanguageCQLv3.3.0">Cassandra Query Language (CQL) v3.3.0</h1><span id="tableOfContents"><ol style="list-style: none;"><li><a href="CQL-2.2.html#CassandraQueryLanguageCQLv3.3.0">Cassandra Query Language (CQL) v3.3.0</a><ol style="list-style: none;"><li><a href="CQL-2.2.html#CQLSyntax">CQL Syntax</a><ol style="list-style: none;"><li><a href="CQL-2.2.html#Preamble">Preamble</a></li><li><a href="CQL-2.2.html#Conventions">Conventions</a></li><li><a href="CQL-2.2.html#identifiers">Identifiers and keywords</a></li><li><a href="CQL-2.2.html#constants">Constants</a></li><li><a href="CQL-2.
 2.html#Comments">Comments</a></li><li><a href="CQL-2.2.html#statements">Statements</a></li><li><a href="CQL-2.2.html#preparedStatement">Prepared Statement</a></li></ol></li><li><a href="CQL-2.2.html#dataDefinition">Data Definition</a><ol style="list-style: none;"><li><a href="CQL-2.2.html#createKeyspaceStmt">CREATE KEYSPACE</a></li><li><a href="CQL-2.2.html#useStmt">USE</a></li><li><a href="CQL-2.2.html#alterKeyspaceStmt">ALTER KEYSPACE</a></li><li><a href="CQL-2.2.html#dropKeyspaceStmt">DROP KEYSPACE</a></li><li><a href="CQL-2.2.html#createTableStmt">CREATE TABLE</a></li><li><a href="CQL-2.2.html#alterTableStmt">ALTER TABLE</a></li><li><a href="CQL-2.2.html#dropTableStmt">DROP TABLE</a></li><li><a href="CQL-2.2.html#truncateStmt">TRUNCATE</a></li><li><a href="CQL-2.2.html#createIndexStmt">CREATE INDEX</a></li><li><a href="CQL-2.2.html#dropIndexStmt">DROP INDEX</a></li><li><a href="CQL-2.2.html#createTypeStmt">CREATE TYPE</a></li><li><a href="CQL-2.2.html#alterTypeStmt">ALTER TYPE</
 a></li><li><a href="CQL-2.2.html#dropTypeStmt">DROP TYPE</a></li><li><a href="CQL-2.2.html#createTriggerStmt">CREATE TRIGGER</a></li><li><a href="CQL-2.2.html#dropTriggerStmt">DROP TRIGGER</a></li><li><a href="CQL-2.2.html#createFunctionStmt">CREATE FUNCTION</a></li><li><a href="CQL-2.2.html#dropFunctionStmt">DROP FUNCTION</a></li><li><a href="CQL-2.2.html#createAggregateStmt">CREATE AGGREGATE</a></li><li><a href="CQL-2.2.html#dropAggregateStmt">DROP AGGREGATE</a></li></ol></li><li><a href="CQL-2.2.html#dataManipulation">Data Manipulation</a><ol style="list-style: none;"><li><a href="CQL-2.2.html#insertStmt">INSERT</a></li><li><a href="CQL-2.2.html#updateStmt">UPDATE</a></li><li><a href="CQL-2.2.html#deleteStmt">DELETE</a></li><li><a href="CQL-2.2.html#batchStmt">BATCH</a></li></ol></li><li><a href="CQL-2.2.html#queries">Queries</a><ol style="list-style: none;"><li><a href="CQL-2.2.html#selectStmt">SELECT</a></li></ol></li><li><a href="CQL-2.2.html#types">Data Types</a><ol style="li
 st-style: none;"><li><a href="CQL-2.2.html#usingtimestamps">Working with timestamps</a></li><li><a href="CQL-2.2.html#usingdates">Working with dates</a></li><li><a href="CQL-2.2.html#usingtime">Working with time</a></li><li><a href="CQL-2.2.html#counters">Counters</a></li><li><a href="CQL-2.2.html#collections">Working with collections</a></li></ol></li><li><a href="CQL-2.2.html#functions">Functions</a><ol style="list-style: none;"><li><a href="CQL-2.2.html#tokenFun">Token</a></li><li><a href="CQL-2.2.html#uuidFun">Uuid</a></li><li><a href="CQL-2.2.html#timeuuidFun">Timeuuid functions</a></li><li><a href="CQL-2.2.html#blobFun">Blob conversion functions</a></li></ol></li><li><a href="CQL-2.2.html#udfs">User-Defined Functions</a></li><li><a href="CQL-2.2.html#udas">User-Defined Aggregates</a></li><li><a href="CQL-2.2.html#json">JSON Support</a><ol style="list-style: none;"><li><a href="CQL-2.2.html#selectJson">SELECT JSON</a></li><li><a href="CQL-2.2.html#insertJson">INSERT JSON</a></l
 i><li><a href="CQL-2.2.html#jsonEncoding">JSON Encoding of Cassandra Data Types</a></li><li><a href="CQL-2.2.html#fromJson">The fromJson() Function</a></li><li><a href="CQL-2.2.html#toJson">The toJson() Function</a></li></ol></li><li><a href="CQL-2.2.html#appendixA">Appendix A: CQL Keywords</a></li><li><a href="CQL-2.2.html#appendixB">Appendix B: CQL Reserved Types</a></li><li><a href="CQL-2.2.html#changes">Changes</a><ol style="list-style: none;"><li><a href="CQL-2.2.html#a3.3.0">3.3.0</a></li><li><a href="CQL-2.2.html#a3.2.0">3.2.0</a></li><li><a href="CQL-2.2.html#a3.1.7">3.1.7</a></li><li><a href="CQL-2.2.html#a3.1.6">3.1.6</a></li><li><a href="CQL-2.2.html#a3.1.5">3.1.5</a></li><li><a href="CQL-2.2.html#a3.1.4">3.1.4</a></li><li><a href="CQL-2.2.html#a3.1.3">3.1.3</a></li><li><a href="CQL-2.2.html#a3.1.2">3.1.2</a></li><li><a href="CQL-2.2.html#a3.1.1">3.1.1</a></li><li><a href="CQL-2.2.html#a3.1.0">3.1.0</a></li><li><a href="CQL-2.2.html#a3.0.5">3.0.5</a></li><li><a href="CQL-
 2.2.html#a3.0.4">3.0.4</a></li><li><a href="CQL-2.2.html#a3.0.3">3.0.3</a></li><li><a href="CQL-2.2.html#a3.0.2">3.0.2</a></li><li><a href="CQL-2.2.html#a3.0.1">3.0.1</a></li></ol></li><li><a href="CQL-2.2.html#Versioning">Versioning</a></li></ol></li></ol></span><h2 id="CQLSyntax">CQL Syntax</h2><h3 id="Preamble">Preamble</h3><p>This document describes the Cassandra Query Language (CQL) version 3. CQL v3 is not backward compatible with CQL v2 and differs from it in numerous ways. Note that this document describes the last version of the languages. However, the <a href="#changes">changes</a> section provides the diff between the different versions of CQL v3.</p><p>CQL v3 offers a model very close to SQL in the sense that data is put in <em>tables</em> containing <em>rows</em> of <em>columns</em>. For that reason, when used in this document, these terms (tables, rows and columns) have the same definition than they have in SQL. But please note that as such, they do <strong>not</strong
 > refer to the concept of rows and columns found in the internal implementation of Cassandra and in the thrift and CQL v2 API.</p><h3 id="Conventions">Conventions</h3><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 <a href="http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form">BNF</a> -like notation:</li></ul><pre class="syntax"><pre>&lt;start> ::= TERMINAL &lt;non-terminal1> &lt;non-terminal1>
 </pre></pre><ul><li>Nonterminal symbols will have <code>&lt;angle brackets></code>.</li><li>As additional shortcut notations to BNF, we&#8217;ll use traditional regular expression&#8217;s symbols (<code>?</code>, <code>+</code> and <code>*</code>) to signify that a given symbol is optional and/or can be repeated. We&#8217;ll also allow parentheses to group symbols and the <code>[&lt;characters>]</code> notation to represent any one of <code>&lt;characters></code>.</li><li>The grammar is provided for documentation purposes and leave some minor details out. For instance, the last column definition in a <code>CREATE TABLE</code> statement is optional but supported if present even though the provided grammar in this document suggest it is not supported. </li><li>Sample code will be provided 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><h3 id="identifiers">Identifiers and keywords</h3><p>The CQL language uses <em>identifiers</em> (or <em>names</em>) to identify tables, columns and other objects. An identifier is a token matching the regular expression <code lang="a-zA-Z">[a-zA-Z0-9_]</code><code>*</code>.</p><p>A number of such identifiers, like <code>SELECT</code> or <code>WITH</code>, are <em>keywords</em>. They have a fixed meaning for the language and most are reserved. The list of those keywords can be found in <a href="#appendixA">Appendix A</a>.</p><p>Identifiers and (unquoted) keywords are case insensitive. Thus <code>SELECT</code> is the same than <code>select</code> or <code>sElEcT</code>, and <code>myId</code> is the same than <code>myid</code> or <code>MYID</code> for instance. A convention often used (in particular by the samples of this documentation) is to use u
 pper case for keywords and lower case for other identifiers.</p><p>There is a second kind of identifiers called <em>quoted identifiers</em> defined by enclosing an arbitrary sequence of characters in double-quotes(<code>"</code>). Quoted identifiers are never keywords. Thus <code>"select"</code> is not a reserved keyword and can be used to refer to a column, while <code>select</code> would raise a parse error. Also, contrarily to unquoted identifiers and keywords, quoted identifiers are case sensitive (<code>"My Quoted Id"</code> is <em>different</em> from <code>"my quoted id"</code>). A fully lowercase quoted identifier that matches <code lang="a-zA-Z">[a-zA-Z0-9_]</code><code>*</code> is equivalent to the unquoted identifier obtained by removing the double-quote (so <code>"myid"</code> is equivalent to <code>myid</code> and to <code>myId</code> but different from <code>"myId"</code>). Inside a quoted identifier, the double-quote character can be repeated to escape it, so <code>"fo
 o "" bar"</code> is a valid identifier.</p><h3 id="constants">Constants</h3><p>CQL defines the following kind of <em>constants</em>: strings, integers, floats, booleans, uuids and blobs:</p><ul><li>A string constant is an arbitrary sequence of characters characters enclosed by single-quote(<code>'</code>). One can include a single-quote in a string by repeating it, e.g. <code>'It''s raining today'</code>. Those are not to be confused with quoted identifiers that use double-quotes.</li><li>An integer constant is defined by <code>'-'?[0-9]+</code>.</li><li>A float constant is defined by <code>'-'?[0-9]+('.'[0-9]*)?([eE][+-]?[0-9+])?</code>. On top of that, <code>NaN</code> and <code>Infinity</code> are also float constants.</li><li>A boolean constant is either <code>true</code> or <code>false</code> up to case-insensitivity (i.e. <code>True</code> is a valid boolean constant).</li><li>A <a href="http://en.wikipedia.org/wiki/Universally_unique_identifier">UUID</a> constant is defined b
 y <code>hex{8}-hex{4}-hex{4}-hex{4}-hex{12}</code> where <code>hex</code> is an hexadecimal character, e.g. <code>[0-9a-fA-F]</code> and <code>{4}</code> is the number of such characters.</li><li>A blob constant is an hexadecimal number defined by <code>0[xX](hex)+</code> where <code>hex</code> is an hexadecimal character, e.g. <code>[0-9a-fA-F]</code>.</li></ul><p>For how these constants are typed, see the <a href="#types">data types section</a>.</p><h3 id="Comments">Comments</h3><p>A comment in CQL is a line beginning by either double dashes (<code>--</code>) or double slash (<code>//</code>).</p><p>Multi-line comments are also supported through enclosure within <code>/*</code> and <code>*/</code> (but nesting is not supported).</p><pre class="sample"><pre>-- This is a comment
 // This is a comment too