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/12/31 22:36:17 UTC

svn commit: r1722472 - /cassandra/site/publish/doc/cql3/CQL-3.0.html

Author: tylerhobbs
Date: Thu Dec 31 21:36:17 2015
New Revision: 1722472

URL: http://svn.apache.org/viewvc?rev=1722472&view=rev
Log:
Fix CREATE MV formatting in CQL docs

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

Modified: cassandra/site/publish/doc/cql3/CQL-3.0.html
URL: http://svn.apache.org/viewvc/cassandra/site/publish/doc/cql3/CQL-3.0.html?rev=1722472&r1=1722471&r2=1722472&view=diff
==============================================================================
--- cassandra/site/publish/doc/cql3/CQL-3.0.html (original)
+++ cassandra/site/publish/doc/cql3/CQL-3.0.html Thu Dec 31 21:36:17 2015
@@ -138,7 +138,19 @@ CREATE CUSTOM INDEX ON users (email) USI
 </pre></pre><p><i>Sample:</i></p><pre class="sample"><pre>DROP INDEX userIndex;
 
 DROP INDEX userkeyspace.address_index;
-</pre></pre><p><br/>The <code>DROP INDEX</code> statement is used to drop an existing secondary index. The argument of the statement is the index name, which may optionally specify the keyspace of the index.</p><p>If the index does not exists, the statement will return an error, unless <code>IF EXISTS</code> is used in which case the operation is a no-op.</p><h3 id="createMVStmt">CREATE MATERIALIZED VIEW</h3><p><i>Syntax:</i></p><p>bc(syntax)..<br/><create-table-stmt> ::= CREATE MATERIALIZED VIEW ( IF NOT EXISTS )? <viewname> AS<br/>                          SELECT ( &#8216;(&#8217; <identifier> ( &#8216;,&#8217; <identifier> ) * &#8216;)&#8217; | &#8216;*&#8217; )<br/>                          FROM <tablename><br/>                          WHERE ( <identifier> IS NOT NULL ( AND <identifier> IS NOT NULL )* )?<br/>                          PRIMARY KEY &#8216;(&#8217; <partition-key> ( &#8216;,&#8217; <identifier> )* ')'<br/>                          ( WITH <option> ( AND <option>)* )
 ?<br/><i>Sample:</i></p><p>bc(sample)..<br/>CREATE MATERIALIZED VIEW monkeySpecies_by_population AS<br/>    SELECT *<br/>    FROM monkeySpecies<br/>    WHERE population IS NOT NULL AND species IS NOT NULL<br/>    PRIMARY KEY (population, species)<br/>    WITH comment=&#8216;Allow query by population instead of species&#8217;;<br/>p.<br/>The <code>CREATE MATERIALIZED VIEW</code> statement creates a new materialized view. Each such view is a set of <em>rows</em> which corresponds to rows which are present in the underlying, or base, table specified in the <code>SELECT</code> statement. A materialized view cannot be directly updated, but updates to the base table will cause corresponding updates in the view.</p><p>Attempting to create an already existing materialized view will return an error unless the <code>IF NOT EXISTS</code> option is used. If it is used, the statement will be a no-op if the materialized view already exists.</p><h4 id="createMVWhere"><code>WHERE &lt;identifier> IS
  NOT NULL</code></h4><p>The where clause is required to explicitly exclude all primary key columns' null values. Any row which contains null values in the primary key will not be present in the materialized view.</p><h3 id="alterMVStmt">ALTER MATERIALIZED VIEW</h3><p><i>Syntax:</i></p><pre class="syntax"><pre>&lt;alter-materialized-view-stmt> ::= ALTER MATERIALIZED VIEW &lt;viewname>
+</pre></pre><p><br/>The <code>DROP INDEX</code> statement is used to drop an existing secondary index. The argument of the statement is the index name, which may optionally specify the keyspace of the index.</p><p>If the index does not exists, the statement will return an error, unless <code>IF EXISTS</code> is used in which case the operation is a no-op.</p><h3 id="createMVStmt">CREATE MATERIALIZED VIEW</h3><p><i>Syntax:</i></p><pre class="syntax"><pre>&lt;create-table-stmt> ::= CREATE MATERIALIZED VIEW ( IF NOT EXISTS )? &lt;viewname> AS
+                          SELECT ( '(' &lt;identifier> ( ',' &lt;identifier> ) * ')' | '*' )
+                          FROM &lt;tablename>
+                          WHERE ( &lt;identifier> IS NOT NULL ( AND &lt;identifier> IS NOT NULL )* )?
+                          PRIMARY KEY '(' &lt;partition-key> ( ',' &lt;identifier> )* ')'
+                          ( WITH &lt;option> ( AND &lt;option>)* )?
+</pre></pre><p><br/><i>Sample:</i></p><pre class="sample"><pre>CREATE MATERIALIZED VIEW monkeySpecies_by_population AS
+    SELECT *
+    FROM monkeySpecies
+    WHERE population IS NOT NULL AND species IS NOT NULL
+    PRIMARY KEY (population, species)
+    WITH comment='Allow query by population instead of species';
+</pre></pre><p><br/>The <code>CREATE MATERIALIZED VIEW</code> statement creates a new materialized view. Each such view is a set of <em>rows</em> which corresponds to rows which are present in the underlying, or base, table specified in the <code>SELECT</code> statement. A materialized view cannot be directly updated, but updates to the base table will cause corresponding updates in the view.</p><p>Attempting to create an already existing materialized view will return an error unless the <code>IF NOT EXISTS</code> option is used. If it is used, the statement will be a no-op if the materialized view already exists.</p><h4 id="createMVWhere"><code>WHERE &lt;identifier> IS NOT NULL</code></h4><p>The where clause is required to explicitly exclude all primary key columns' null values. Any row which contains null values in the primary key will not be present in the materialized view.</p><h3 id="alterMVStmt">ALTER MATERIALIZED VIEW</h3><p><i>Syntax:</i></p><pre class="syntax"><pre>&lt;alte
 r-materialized-view-stmt> ::= ALTER MATERIALIZED VIEW &lt;viewname>
                                                  WITH &lt;option> ( AND &lt;option> )*
 </pre></pre><p>p.<br/>The <code>ALTER MATERIALIZED VIEW</code> statement allows options to be update; these options are the same as <a href="#createTableOptions"><code>CREATE TABLE</code>'s options</a>.</p><h3 id="dropMVStmt">DROP MATERIALIZED VIEW</h3><p><i>Syntax:</i></p><pre class="syntax"><pre>&lt;drop-materialized-stmt> ::= DROP MATERIALIZED VIEW ( IF EXISTS )? &lt;tablename>
 </pre></pre><p><i>Sample:</i></p><pre class="sample"><pre>DROP MATERIALIZED VIEW monkeySpecies_by_population;