Modified: cassandra/site/src/doc/4.0/cql/changes.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/changes.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/changes.html (original) +++ cassandra/site/src/doc/4.0/cql/changes.html Tue May 16 02:01:22 2017 @@ -68,30 +68,33 @@ extra-footer: ' <li class="toctree-l2"><a class="reference internal" href="mvs.html">Materialized Views</a></li> <li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> <li class="toctree-l2"><a class="reference internal" href="triggers.html">Triggers</a></li> <li class="toctree-l2"><a class="reference internal" href="appendices.html">Appendices</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">Changes</a><ul> -<li class="toctree-l3"><a class="reference internal" href="#id1">3.4.3</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id2">3.4.2</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id3">3.4.1</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id4">3.4.0</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id5">3.3.1</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id6">3.3.0</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id7">3.2.0</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id8">3.1.7</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id9">3.1.6</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id10">3.1.5</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id11">3.1.4</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id12">3.1.3</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id13">3.1.2</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id14">3.1.1</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id15">3.1.0</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id16">3.0.5</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id17">3.0.4</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id18">3.0.3</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id19">3.0.2</a></li> -<li class="toctree-l3"><a class="reference internal" href="#id20">3.0.1</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id1">3.4.5</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id2">3.4.4</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id3">3.4.3</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id6">3.4.2</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id7">3.4.1</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id8">3.4.0</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id9">3.3.1</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id10">3.3.0</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id11">3.2.0</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id12">3.1.7</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id13">3.1.6</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id14">3.1.5</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id15">3.1.4</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id16">3.1.3</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id17">3.1.2</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id18">3.1.1</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id19">3.1.0</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id20">3.0.5</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id21">3.0.4</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id22">3.0.3</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id23">3.0.2</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id24">3.0.1</a></li> <li class="toctree-l3"><a class="reference internal" href="#versioning">Versioning</a></li> </ul> </li> @@ -101,7 +104,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> @@ -121,16 +124,31 @@ extra-footer: ' <h1>Changes<a class="headerlink" href="#changes" title="Permalink to this headline">¶</a></h1> <p>The following describes the changes in each version of CQL.</p> <div class="section" id="id1"> -<h2>3.4.3<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2> +<h2>3.4.5<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2> <ul class="simple"> +<li>Adds support for arithmetic operators (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-11935">CASSANDRA-11935</a>)</li> +<li>Adds support for <code class="docutils literal"><span class="pre">+</span></code> and <code class="docutils literal"><span class="pre">-</span></code> operations on dates (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-11936">CASSANDRA-11936</a>)</li> +<li>Adds <code class="docutils literal"><span class="pre">currentTimestamp</span></code>, <code class="docutils literal"><span class="pre">currentDate</span></code>, <code class="docutils literal"><span class="pre">currentTime</span></code> and <code class="docutils literal"><span class="pre">currentTimeUUID</span></code> functions (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-13132">CASSANDRA-13132</a>)</li> +</ul> +</div> +<div class="section" id="id2"> +<h2>3.4.4<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2> +<ul class="simple"> +<li><code class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span></code> <code class="docutils literal"><span class="pre">ALTER</span></code> has been removed; a column’s type may not be changed after creation (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-12443">CASSANDRA-12443</a>).</li> +<li><code class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TYPE</span></code> <code class="docutils literal"><span class="pre">ALTER</span></code> has been removed; a field’s type may not be changed after creation (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-12443">CASSANDRA-12443</a>).</li> +</ul> +</div> +<div class="section" id="id3"> +<h2>3.4.3<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2> +<ul class="simple"> +<li>Adds a new <a href="#id4"><span class="problematic" id="id5">``</span></a>duration `` <a class="reference internal" href="types.html#data-types"><span class="std std-ref">data types</span></a> (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-11873">CASSANDRA-11873</a>).</li> <li>Support for <code class="docutils literal"><span class="pre">GROUP</span> <span class="pre">BY</span></code> (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-10707">CASSANDRA-10707</a>).</li> <li>Adds a <code class="docutils literal"><span class="pre">DEFAULT</span> <span class="pre">UNSET</span></code> option for <code class="docutils literal"><span class="pre">INSERT</span> <span class="pre">JSON</span></code> to ignore omitted columns (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-11424">CASSANDRA-11424</a>).</li> -<li>Allows <code class="docutils literal"><span class="pre">null</span></code> as a legal value for TTL on insert and update. It will be treated as equivalent to</li> +<li>Allows <code class="docutils literal"><span class="pre">null</span></code> as a legal value for TTL on insert and update. It will be treated as equivalent to inserting a 0 (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-12216">CASSANDRA-12216</a>).</li> </ul> -<p>inserting a 0 (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-12216">CASSANDRA-12216</a>).</p> </div> -<div class="section" id="id2"> -<h2>3.4.2<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id6"> +<h2>3.4.2<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>If a table has a non zero <code class="docutils literal"><span class="pre">default_time_to_live</span></code>, then explicitly specifying a TTL of 0 in an <code class="docutils literal"><span class="pre">INSERT</span></code> or <code class="docutils literal"><span class="pre">UPDATE</span></code> statement will result in the new writes not having any expiration (that is, an explicit TTL of 0 cancels @@ -144,28 +162,28 @@ new <code class="docutils literal"><span deleted in <code class="docutils literal"><span class="pre">UPDATE</span></code> statements and <code class="docutils literal"><span class="pre">DELETE</span></code> statements, respectively. (<a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-7423)">CASSANDRA-7423</a>).</li> </ul> </div> -<div class="section" id="id3"> -<h2>3.4.1<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id7"> +<h2>3.4.1<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>Adds <code class="docutils literal"><span class="pre">CAST</span></code> functions.</li> </ul> </div> -<div class="section" id="id4"> -<h2>3.4.0<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id8"> +<h2>3.4.0<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>Support for <a class="reference internal" href="mvs.html#materialized-views"><span class="std std-ref">materialized views</span></a>.</li> <li><code class="docutils literal"><span class="pre">DELETE</span></code> support for inequality expressions and <code class="docutils literal"><span class="pre">IN</span></code> restrictions on any primary key columns.</li> <li><code class="docutils literal"><span class="pre">UPDATE</span></code> support for <code class="docutils literal"><span class="pre">IN</span></code> restrictions on any primary key columns.</li> </ul> </div> -<div class="section" id="id5"> -<h2>3.3.1<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id9"> +<h2>3.3.1<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>The syntax <code class="docutils literal"><span class="pre">TRUNCATE</span> <span class="pre">TABLE</span> <span class="pre">X</span></code> is now accepted as an alias for <code class="docutils literal"><span class="pre">TRUNCATE</span> <span class="pre">X</span></code>.</li> </ul> </div> -<div class="section" id="id6"> -<h2>3.3.0<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id10"> +<h2>3.3.0<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><a class="reference internal" href="functions.html#cql-functions"><span class="std std-ref">User-defined functions and aggregates</span></a> are now supported.</li> <li>Allows double-dollar enclosed strings literals as an alternative to single-quote enclosed strings.</li> @@ -175,8 +193,8 @@ deleted in <code class="docutils literal <li>Adds new time conversion functions and deprecate <code class="docutils literal"><span class="pre">dateOf</span></code> and <code class="docutils literal"><span class="pre">unixTimestampOf</span></code>.</li> </ul> </div> -<div class="section" id="id7"> -<h2>3.2.0<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id11"> +<h2>3.2.0<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><a class="reference internal" href="types.html#udts"><span class="std std-ref">User-defined types</span></a> supported.</li> <li><code class="docutils literal"><span class="pre">CREATE</span> <span class="pre">INDEX</span></code> now supports indexing collection columns, including indexing the keys of map collections through the @@ -186,8 +204,8 @@ deleted in <code class="docutils literal <li><code class="docutils literal"><span class="pre">DROP</span> <span class="pre">INDEX</span></code> now supports optionally specifying a keyspace.</li> </ul> </div> -<div class="section" id="id8"> -<h2>3.1.7<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id12"> +<h2>3.1.7<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><code class="docutils literal"><span class="pre">SELECT</span></code> statements now support selecting multiple rows in a single partition using an <code class="docutils literal"><span class="pre">IN</span></code> clause on combinations of clustering columns.</li> @@ -195,41 +213,41 @@ of clustering columns.</li> respectively.</li> </ul> </div> -<div class="section" id="id9"> -<h2>3.1.6<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id13"> +<h2>3.1.6<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>A new <code class="docutils literal"><span class="pre">uuid()</span></code> method has been added.</li> <li>Support for <code class="docutils literal"><span class="pre">DELETE</span> <span class="pre">...</span> <span class="pre">IF</span> <span class="pre">EXISTS</span></code> syntax.</li> </ul> </div> -<div class="section" id="id10"> -<h2>3.1.5<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id14"> +<h2>3.1.5<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>It is now possible to group clustering columns in a relation, see <a class="reference internal" href="dml.html#where-clause"><span class="std std-ref">WHERE</span></a> clauses.</li> <li>Added support for <a class="reference internal" href="ddl.html#static-columns"><span class="std std-ref">static columns</span></a>.</li> </ul> </div> -<div class="section" id="id11"> -<h2>3.1.4<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id15"> +<h2>3.1.4<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><code class="docutils literal"><span class="pre">CREATE</span> <span class="pre">INDEX</span></code> now allows specifying options when creating CUSTOM indexes.</li> </ul> </div> -<div class="section" id="id12"> -<h2>3.1.3<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id16"> +<h2>3.1.3<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>Millisecond precision formats have been added to the <a class="reference internal" href="types.html#timestamps"><span class="std std-ref">timestamp</span></a> parser.</li> </ul> </div> -<div class="section" id="id13"> -<h2>3.1.2<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id17"> +<h2>3.1.2<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><code class="docutils literal"><span class="pre">NaN</span></code> and <code class="docutils literal"><span class="pre">Infinity</span></code> has been added as valid float constants. They are now reserved keywords. In the unlikely case you we using them as a column identifier (or keyspace/table one), you will now need to double quote them.</li> </ul> </div> -<div class="section" id="id14"> -<h2>3.1.1<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id18"> +<h2>3.1.1<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><code class="docutils literal"><span class="pre">SELECT</span></code> statement now allows listing the partition keys (using the <code class="docutils literal"><span class="pre">DISTINCT</span></code> modifier). See <a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-4536">CASSANDRA-4536</a>.</li> <li>The syntax <code class="docutils literal"><span class="pre">c</span> <span class="pre">IN</span> <span class="pre">?</span></code> is now supported in <code class="docutils literal"><span class="pre">WHERE</span></code> clauses. In that case, the value expected for the bind variable @@ -237,8 +255,8 @@ will be a list of whatever type <code cl <li>It is now possible to use named bind variables (using <code class="docutils literal"><span class="pre">:name</span></code> instead of <code class="docutils literal"><span class="pre">?</span></code>).</li> </ul> </div> -<div class="section" id="id15"> -<h2>3.1.0<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id19"> +<h2>3.1.0<a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><code class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span></code> <code class="docutils literal"><span class="pre">DROP</span></code> option added.</li> <li><code class="docutils literal"><span class="pre">SELECT</span></code> statement now supports aliases in select clause. Aliases in WHERE and ORDER BY clauses are not supported.</li> @@ -247,14 +265,14 @@ Similarly, <code class="docutils literal <li><code class="docutils literal"><span class="pre">INSERT</span></code> statements optionally supports a <code class="docutils literal"><span class="pre">IF</span> <span class="pre">NOT</span> <span class="pre">EXISTS</span></code> condition and <code class="docutils literal"><span class="pre">UPDATE</span></code> supports <code class="docutils literal"><span class="pre">IF</span></code> conditions.</li> </ul> </div> -<div class="section" id="id16"> -<h2>3.0.5<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id20"> +<h2>3.0.5<a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><code class="docutils literal"><span class="pre">SELECT</span></code>, <code class="docutils literal"><span class="pre">UPDATE</span></code>, and <code class="docutils literal"><span class="pre">DELETE</span></code> statements now allow empty <code class="docutils literal"><span class="pre">IN</span></code> relations (see <a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-5626)">CASSANDRA-5626</a>.</li> </ul> </div> -<div class="section" id="id17"> -<h2>3.0.4<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id21"> +<h2>3.0.4<a class="headerlink" href="#id21" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>Updated the syntax for custom <a class="reference internal" href="indexes.html#secondary-indexes"><span class="std std-ref">secondary indexes</span></a>.</li> <li>Non-equal condition on the partition key are now never supported, even for ordering partitioner as this was not @@ -262,14 +280,14 @@ correct (the order was <strong>not</stro be used for range queries on the partition key (see <a class="reference internal" href="dml.html#where-clause"><span class="std std-ref">WHERE clauses</span></a>).</li> </ul> </div> -<div class="section" id="id18"> -<h2>3.0.3<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id22"> +<h2>3.0.3<a class="headerlink" href="#id22" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>Support for custom <a class="reference internal" href="indexes.html#secondary-indexes"><span class="std std-ref">secondary indexes</span></a> has been added.</li> </ul> </div> -<div class="section" id="id19"> -<h2>3.0.2<a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id23"> +<h2>3.0.2<a class="headerlink" href="#id23" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>Type validation for the <a class="reference internal" href="definitions.html#constants"><span class="std std-ref">constants</span></a> has been fixed. For instance, the implementation used to allow <code class="docutils literal"><span class="pre">'2'</span></code> as a valid value for an <code class="docutils literal"><span class="pre">int</span></code> column (interpreting it has the equivalent of <code class="docutils literal"><span class="pre">2</span></code>), or <code class="docutils literal"><span class="pre">42</span></code> as a valid @@ -284,8 +302,8 @@ as blobs, you should thus update your cl now also allowed in select clauses. See the <a class="reference internal" href="functions.html#cql-functions"><span class="std std-ref">section on functions</span></a> for details.</li> </ul> </div> -<div class="section" id="id20"> -<h2>3.0.1<a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h2> +<div class="section" id="id24"> +<h2>3.0.1<a class="headerlink" href="#id24" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>Date strings (and timestamps) are no longer accepted as valid <code class="docutils literal"><span class="pre">timeuuid</span></code> values. Doing so was a bug in the sense that date string are not valid <code class="docutils literal"><span class="pre">timeuuid</span></code>, and it was thus resulting in <a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-4936">confusing behaviors</a>. However, the following new methods have been added to help
Modified: cassandra/site/src/doc/4.0/cql/ddl.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/ddl.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/ddl.html (original) +++ cassandra/site/src/doc/4.0/cql/ddl.html Tue May 16 02:01:22 2017 @@ -79,6 +79,7 @@ extra-footer: ' <li class="toctree-l2"><a class="reference internal" href="mvs.html">Materialized Views</a></li> <li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> <li class="toctree-l2"><a class="reference internal" href="triggers.html">Triggers</a></li> <li class="toctree-l2"><a class="reference internal" href="appendices.html">Appendices</a></li> @@ -89,7 +90,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> @@ -412,7 +413,7 @@ instance, given:</p> <span class="n">a</span> <span class="nb">int</span><span class="p">,</span> <span class="n">b</span> <span class="nb">int</span><span class="p">,</span> <span class="n">c</span> <span class="nb">int</span><span class="p">,</span> - <span class="k">PRIMARY</span> <span class="k">KEY</span> <span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">d</span><span class="p">)</span> + <span class="k">PRIMARY</span> <span class="k">KEY</span> <span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span><span class="p">)</span> <span class="p">);</span> <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">t</span><span class="p">;</span> @@ -443,14 +444,14 @@ options of a table are described in the <p class="first admonition-title">Warning</p> <p class="last">Since Cassandra 3.0, compact tables have the exact same layout internally than non compact ones (for the same schema obviously), and declaring a table compact <strong>only</strong> creates artificial limitations on the table definition -and usage that are necessary to ensure backward compatibility with the deprecated Thrift API. And as <code class="docutils literal"><span class="pre">COMPACT</span> +and usage. It only exists for historical reason and is preserved for backward compatibility And as <code class="docutils literal"><span class="pre">COMPACT</span> <span class="pre">STORAGE</span></code> cannot, as of Cassandra 4.0, be removed, it is strongly discouraged to create new table with the <code class="docutils literal"><span class="pre">COMPACT</span> <span class="pre">STORAGE</span></code> option.</p> </div> -<p>A <em>compact</em> table is one defined with the <code class="docutils literal"><span class="pre">COMPACT</span> <span class="pre">STORAGE</span></code> option. This option is mainly targeted towards backward -compatibility for definitions created before CQL version 3 (see <a class="reference external" href="http://www.datastax.com/dev/blog/thrift-to-cql3">www.datastax.com/dev/blog/thrift-to-cql3</a> for more details) and shouldn’t be used for new tables. Declaring a -table with this option creates limitations for the table which are largely arbitrary but necessary for backward -compatibility with the (deprecated) Thrift API. Amongst those limitation:</p> +<p>A <em>compact</em> table is one defined with the <code class="docutils literal"><span class="pre">COMPACT</span> <span class="pre">STORAGE</span></code> option. This option is only maintained for backward +compatibility for definitions created before CQL version 3 and shouldn’t be used for new tables. Declaring a +table with this option creates limitations for the table which are largely arbitrary (and exists for historical +reasons). Amongst those limitation:</p> <ul class="simple"> <li>a compact table cannot use collections nor static columns.</li> <li>if a compact table has at least one clustering column, then it must have <em>exactly</em> one column outside of the primary @@ -666,15 +667,12 @@ anticipate future usage when creating a <p>Altering an existing table uses the <code class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span></code> statement:</p> <pre> <strong id="grammar-token-alter_table_statement">alter_table_statement </strong> ::= ALTER TABLE <a class="reference internal" href="#grammar-token-table_name"><code class="xref docutils literal"><span class="pre">table_name</span></code></a> <a class="reference internal" href="#grammar-token-alter_table_instruction"><code class="xref docutils literal"><span class="pre">alter_table_instruction</span></code></a> -<strong id="grammar-token-alter_table_instruction">alter_table_instruction</strong> ::= ALTER <a class="reference internal" href="#grammar-token-column_name"><code class="xref docutils literal"><span class="pre">column_name</span></code></a> TYPE <a class="reference internal" href="types.html#grammar-token-cql_type"><code class="xref docutils literal"><span class="pre">cql_type</span></code></a> - | ADD <a class="reference internal" href="#grammar-token-column_name"><code class="xref docutils literal"><span class="pre">column_name</span></code></a> <a class="reference internal" href="types.html#grammar-token-cql_type"><code class="xref docutils literal"><span class="pre">cql_type</span></code></a> ( ',' <a class="reference internal" href="#grammar-token-column_name"><code class="xref docutils literal"><span class="pre">column_name</span></code></a> <a class="reference internal" href="types.html#grammar-token-cql_type"><code class="xref docutils literal"><span class="pre">cql_type</span></code></a> )* +<strong id="grammar-token-alter_table_instruction">alter_table_instruction</strong> ::= ADD <a class="reference internal" href="#grammar-token-column_name"><code class="xref docutils literal"><span class="pre">column_name</span></code></a> <a class="reference internal" href="types.html#grammar-token-cql_type"><code class="xref docutils literal"><span class="pre">cql_type</span></code></a> ( ',' <a class="reference internal" href="#grammar-token-column_name"><code class="xref docutils literal"><span class="pre">column_name</span></code></a> <a class="reference internal" href="types.html#grammar-token-cql_type"><code class="xref docutils literal"><span class="pre">cql_type</span></code></a> )* | DROP <a class="reference internal" href="#grammar-token-column_name"><code class="xref docutils literal"><span class="pre">column_name</span></code></a> ( <a class="reference internal" href="#grammar-token-column_name"><code class="xref docutils literal"><span class="pre">column_name</span></code></a> )* | WITH <a class="reference internal" href="#grammar-token-options"><code class="xref docutils literal"><span class="pre">options</span></code></a> </pre> <p>For instance:</p> -<div class="highlight-cql"><div class="highlight"><pre><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">addamsFamily</span> <span class="k">ALTER</span> <span class="n">lastKnownLocation</span> <span class="k">TYPE</span> <span class="nb">uuid</span><span class="p">;</span> - -<span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">addamsFamily</span> <span class="k">ADD</span> <span class="n">gravesite</span> <span class="nb">varchar</span><span class="p">;</span> +<div class="highlight-cql"><div class="highlight"><pre><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">addamsFamily</span> <span class="k">ADD</span> <span class="n">gravesite</span> <span class="nb">varchar</span><span class="p">;</span> <span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">addamsFamily</span> <span class="k">WITH</span> <span class="n">comment</span> <span class="o">=</span> <span class="s1">'A most excellent and useful table'</span> @@ -683,11 +681,6 @@ anticipate future usage when creating a </div> <p>The <code class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span></code> statement can:</p> <ul class="simple"> -<li>Change the type of one of the column in the table (through the <code class="docutils literal"><span class="pre">ALTER</span></code> instruction). Note that the type of a column -cannot be changed arbitrarily. The change of type should be such that any value of the previous type should be a valid -value of the new type. Further, for <a class="reference internal" href="#clustering-columns"><span class="std std-ref">clustering columns</span></a> and columns on which a secondary -index is defined, the new type must sort values in the same way the previous type does. See the <a class="reference internal" href="#alter-table-type-compatibility"><span class="std std-ref">type -compatibility table</span></a> below for detail on which type changes are accepted.</li> <li>Add new column(s) to the table (through the <code class="docutils literal"><span class="pre">ADD</span></code> instruction). Note that the primary key of a table cannot be changed and thus newly added column will, by extension, never be part of the primary key. Also note that <a class="reference internal" href="#compact-tables"><span class="std std-ref">compact tables</span></a> have restrictions regarding column addition. Note that this is constant (in the amount of @@ -713,75 +706,6 @@ convention. Please be aware that if you <p class="last">Once a column is dropped, it is allowed to re-add a column with the same name than the dropped one <strong>unless</strong> the type of the dropped column was a (non-frozen) column (due to an internal technical limitation).</p> </div> -<div class="section" id="cql-type-compatibility"> -<span id="alter-table-type-compatibility"></span><h3>CQL type compatibility:<a class="headerlink" href="#cql-type-compatibility" title="Permalink to this headline">¶</a></h3> -<p>CQL data types may be converted only as the following table.</p> -<table border="1" class="docutils"> -<colgroup> -<col width="73%" /> -<col width="27%" /> -</colgroup> -<thead valign="bottom"> -<tr class="row-odd"><th class="head">Existing type</th> -<th class="head">Can be altered to:</th> -</tr> -</thead> -<tbody valign="top"> -<tr class="row-even"><td>timestamp</td> -<td>bigint</td> -</tr> -<tr class="row-odd"><td>ascii, bigint, boolean, date, decimal, double, float, -inet, int, smallint, text, time, timestamp, timeuuid, -tinyint, uuid, varchar, varint</td> -<td>blob</td> -</tr> -<tr class="row-even"><td>int</td> -<td>date</td> -</tr> -<tr class="row-odd"><td>ascii, varchar</td> -<td>text</td> -</tr> -<tr class="row-even"><td>bigint</td> -<td>time</td> -</tr> -<tr class="row-odd"><td>bigint</td> -<td>timestamp</td> -</tr> -<tr class="row-even"><td>timeuuid</td> -<td>uuid</td> -</tr> -<tr class="row-odd"><td>ascii, text</td> -<td>varchar</td> -</tr> -<tr class="row-even"><td>bigint, int, timestamp</td> -<td>varint</td> -</tr> -</tbody> -</table> -<p>Clustering columns have stricter requirements, only the following conversions are allowed:</p> -<table border="1" class="docutils"> -<colgroup> -<col width="52%" /> -<col width="48%" /> -</colgroup> -<thead valign="bottom"> -<tr class="row-odd"><th class="head">Existing type</th> -<th class="head">Can be altered to</th> -</tr> -</thead> -<tbody valign="top"> -<tr class="row-even"><td>ascii, text, varchar</td> -<td>blob</td> -</tr> -<tr class="row-odd"><td>ascii, varchar</td> -<td>text</td> -</tr> -<tr class="row-even"><td>ascii, text</td> -<td>varchar</td> -</tr> -</tbody> -</table> -</div> </div> <div class="section" id="drop-table"> <span id="drop-table-statement"></span><h2>DROP TABLE<a class="headerlink" href="#drop-table" title="Permalink to this headline">¶</a></h2> Modified: cassandra/site/src/doc/4.0/cql/definitions.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/definitions.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/definitions.html (original) +++ cassandra/site/src/doc/4.0/cql/definitions.html Tue May 16 02:01:22 2017 @@ -77,6 +77,7 @@ extra-footer: ' <li class="toctree-l2"><a class="reference internal" href="mvs.html">Materialized Views</a></li> <li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> <li class="toctree-l2"><a class="reference internal" href="triggers.html">Triggers</a></li> <li class="toctree-l2"><a class="reference internal" href="appendices.html">Appendices</a></li> @@ -87,7 +88,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> @@ -188,11 +189,12 @@ escape single-quote characters in functi <h2>Terms<a class="headerlink" href="#terms" title="Permalink to this headline">¶</a></h2> <p>CQL has the notion of a <em>term</em>, which denotes the kind of values that CQL support. Terms are defined by:</p> <pre> -<strong id="grammar-token-term">term </strong> ::= <a class="reference internal" href="#grammar-token-constant"><code class="xref docutils literal"><span class="pre">constant</span></code></a> | <a class="reference internal" href="#grammar-token-literal"><code class="xref docutils literal"><span class="pre">literal</span></code></a> | <a class="reference internal" href="#grammar-token-function_call"><code class="xref docutils literal"><span class="pre">function_call</span></code></a> | <a class="reference internal" href="#grammar-token-type_hint"><code class="xref docutils literal"><span class="pre">type_hint</span></code></a> | <a class="reference internal" href="#grammar-token-bind_marker"><code class="xref docutils literal"><span class="pre">bind_marker</span></code></a> -<strong id="grammar-token-literal">literal </strong> ::= <a class="reference internal" href="types.html#grammar-token-collection_literal"><code class="xref docutils literal"><span class="pre">collection_literal</span></code></a> | <a class="reference internal" href="types.html#grammar-token-udt_literal"><code class="xref docutils literal"><span class="pre">udt_literal</span></code></a> | <a class="reference internal" href="types.html#grammar-token-tuple_literal"><code class="xref docutils literal"><span class="pre">tuple_literal</span></code></a> -<strong id="grammar-token-function_call">function_call</strong> ::= <a class="reference internal" href="#grammar-token-identifier"><code class="xref docutils literal"><span class="pre">identifier</span></code></a> '(' [ <a class="reference internal" href="#grammar-token-term"><code class="xref docutils literal"><span class="pre">term</span></code></a> (',' <a class="reference internal" href="#grammar-token-term"><code class="xref docutils literal"><span class="pre">term</span></code></a>)* ] ')' -<strong id="grammar-token-type_hint">type_hint </strong> ::= '(' <a class="reference internal" href="types.html#grammar-token-cql_type"><code class="xref docutils literal"><span class="pre">cql_type</span></code></a> `)` term -<strong id="grammar-token-bind_marker">bind_marker </strong> ::= '?' | ':' <a class="reference internal" href="#grammar-token-identifier"><code class="xref docutils literal"><span class="pre">identifier</span></code></a> +<strong id="grammar-token-term">term </strong> ::= <a class="reference internal" href="#grammar-token-constant"><code class="xref docutils literal"><span class="pre">constant</span></code></a> | <a class="reference internal" href="#grammar-token-literal"><code class="xref docutils literal"><span class="pre">literal</span></code></a> | <a class="reference internal" href="#grammar-token-function_call"><code class="xref docutils literal"><span class="pre">function_call</span></code></a> | <a class="reference internal" href="#grammar-token-arithmetic_operation"><code class="xref docutils literal"><span class="pre">arithmetic_operation</span></code></a> | <a class="reference internal" href="#grammar-token-type_hint"><code class="xref docutils literal"><span class="pre">type_hint</span></code></a> | <a class="reference internal" href="#grammar-token-bind_marker"><code class="xref docutils literal"><span class="pre">bind_marker</span></code></a> +<strong id="grammar-token-literal">literal </strong> ::= <a class="reference internal" href="types.html#grammar-token-collection_literal"><code class="xref docutils literal"><span class="pre">collection_literal</span></code></a> | <a class="reference internal" href="types.html#grammar-token-udt_literal"><code class="xref docutils literal"><span class="pre">udt_literal</span></code></a> | <a class="reference internal" href="types.html#grammar-token-tuple_literal"><code class="xref docutils literal"><span class="pre">tuple_literal</span></code></a> +<strong id="grammar-token-function_call">function_call </strong> ::= <a class="reference internal" href="#grammar-token-identifier"><code class="xref docutils literal"><span class="pre">identifier</span></code></a> '(' [ <a class="reference internal" href="#grammar-token-term"><code class="xref docutils literal"><span class="pre">term</span></code></a> (',' <a class="reference internal" href="#grammar-token-term"><code class="xref docutils literal"><span class="pre">term</span></code></a>)* ] ')' +<strong id="grammar-token-arithmetic_operation">arithmetic_operation</strong> ::= '-' <a class="reference internal" href="#grammar-token-term"><code class="xref docutils literal"><span class="pre">term</span></code></a> | <a class="reference internal" href="#grammar-token-term"><code class="xref docutils literal"><span class="pre">term</span></code></a> ('+' | '-' | '*' | '/' | '%') <a class="reference internal" href="#grammar-token-term"><code class="xref docutils literal"><span class="pre">term</span></code></a> +<strong id="grammar-token-type_hint">type_hint </strong> ::= '(' <a class="reference internal" href="types.html#grammar-token-cql_type"><code class="xref docutils literal"><span class="pre">cql_type</span></code></a> `)` term +<strong id="grammar-token-bind_marker">bind_marker </strong> ::= '?' | ':' <a class="reference internal" href="#grammar-token-identifier"><code class="xref docutils literal"><span class="pre">identifier</span></code></a> </pre> <p>A term is thus one of:</p> <ul class="simple"> @@ -200,6 +202,7 @@ escape single-quote characters in functi <li>A literal for either <a class="reference internal" href="types.html#collections"><span class="std std-ref">a collection</span></a>, <a class="reference internal" href="types.html#udts"><span class="std std-ref">a user-defined type</span></a> or <a class="reference internal" href="types.html#tuples"><span class="std std-ref">a tuple</span></a> (see the linked sections for details).</li> <li>A function call: see <a class="reference internal" href="functions.html#cql-functions"><span class="std std-ref">the section on functions</span></a> for details on which <a class="reference internal" href="functions.html#native-functions"><span class="std std-ref">native function</span></a> exists and how to define your own <a class="reference internal" href="functions.html#udfs"><span class="std std-ref">user-defined ones</span></a>.</li> +<li>An arithmetic operation between terms. see <a class="reference internal" href="operators.html#arithmetic-operators"><span class="std std-ref">the section on arithmetic operations</span></a></li> <li>A <em>type hint</em>: see the <span class="xref std std-ref">related section</span> for details.</li> <li>A bind marker, which denotes a variable to be bound at execution time. See the section on <a class="reference internal" href="#prepared-statements"><span class="std std-ref">Prepared Statements</span></a> for details. A bind marker can be either anonymous (<code class="docutils literal"><span class="pre">?</span></code>) or named (<code class="docutils literal"><span class="pre">:some_name</span></code>). The latter form provides a more Modified: cassandra/site/src/doc/4.0/cql/dml.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/dml.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/dml.html (original) +++ cassandra/site/src/doc/4.0/cql/dml.html Tue May 16 02:01:22 2017 @@ -75,6 +75,7 @@ extra-footer: ' <li class="toctree-l2"><a class="reference internal" href="mvs.html">Materialized Views</a></li> <li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> <li class="toctree-l2"><a class="reference internal" href="triggers.html">Triggers</a></li> <li class="toctree-l2"><a class="reference internal" href="appendices.html">Appendices</a></li> @@ -85,7 +86,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> @@ -521,6 +522,7 @@ none will). See the notes on <a class="r resolution procedure in the case of <a class="reference external" href="http://wiki.apache.org/cassandra/FAQ#clocktie">timestamp ties</a>, operations may be applied in an order that is different from the order they are listed in the <code class="docutils literal"><span class="pre">BATCH</span></code> statement. To force a particular operation ordering, you must specify per-operation timestamps.</li> +<li>A LOGGED batch to a single partition will be converted to an UNLOGGED batch as an optimization.</li> </ul> <div class="section" id="unlogged-batches"> <span id="id4"></span><h3><code class="docutils literal"><span class="pre">UNLOGGED</span></code> batches<a class="headerlink" href="#unlogged-batches" title="Permalink to this headline">¶</a></h3> Modified: cassandra/site/src/doc/4.0/cql/functions.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/functions.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/functions.html (original) +++ cassandra/site/src/doc/4.0/cql/functions.html Tue May 16 02:01:22 2017 @@ -12,7 +12,7 @@ doc-title: "Functions" doc-header-links: ' <link rel="top" title="Apache Cassandra Documentation v4.0" href="../index.html"/> <link rel="up" title="The Cassandra Query Language (CQL)" href="index.html"/> - <link rel="next" title="JSON Support" href="json.html"/> + <link rel="next" title="Arithmetic Operators" href="operators.html"/> <link rel="prev" title="Security" href="security.html"/> ' doc-search-path: "../search.html" @@ -72,6 +72,7 @@ extra-footer: ' <li class="toctree-l3"><a class="reference internal" href="#aggregate-functions">Aggregate functions</a></li> </ul> </li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> <li class="toctree-l2"><a class="reference internal" href="triggers.html">Triggers</a></li> <li class="toctree-l2"><a class="reference internal" href="appendices.html">Appendices</a></li> @@ -82,7 +83,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> @@ -238,13 +239,14 @@ the partitioner in use:</p> <span id="id3"></span><h4>Timeuuid functions<a class="headerlink" href="#timeuuid-functions" title="Permalink to this headline">¶</a></h4> <div class="section" id="now"> <h5><code class="docutils literal"><span class="pre">now</span></code><a class="headerlink" href="#now" title="Permalink to this headline">¶</a></h5> -<p>The <code class="docutils literal"><span class="pre">now</span></code> function takes no arguments and generates, on the coordinator node, a new unique timeuuid (at the time where -the statement using it is executed). Note that this method is useful for insertion but is largely non-sensical in +<p>The <code class="docutils literal"><span class="pre">now</span></code> function takes no arguments and generates, on the coordinator node, a new unique timeuuid at the +time the function is invoked. Note that this method is useful for insertion but is largely non-sensical in <code class="docutils literal"><span class="pre">WHERE</span></code> clauses. For instance, a query of the form:</p> <div class="highlight-cql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">myTable</span> <span class="k">WHERE</span> <span class="n">t</span> <span class="o">=</span> <span class="n">now</span><span class="p">()</span> </pre></div> </div> <p>will never return any result by design, since the value returned by <code class="docutils literal"><span class="pre">now()</span></code> is guaranteed to be unique.</p> +<p><code class="docutils literal"><span class="pre">currentTimeUUID</span></code> is an alias of <code class="docutils literal"><span class="pre">now</span></code>.</p> </div> <div class="section" id="mintimeuuid-and-maxtimeuuid"> <h5><code class="docutils literal"><span class="pre">minTimeuuid</span></code> and <code class="docutils literal"><span class="pre">maxTimeuuid</span></code><a class="headerlink" href="#mintimeuuid-and-maxtimeuuid" title="Permalink to this headline">¶</a></h5> @@ -269,8 +271,43 @@ for querying (as in the example above). </div> </div> </div> +<div class="section" id="datetime-functions"> +<h4>Datetime functions<a class="headerlink" href="#datetime-functions" title="Permalink to this headline">¶</a></h4> +<div class="section" id="retrieving-the-current-date-time"> +<h5>Retrieving the current date/time<a class="headerlink" href="#retrieving-the-current-date-time" title="Permalink to this headline">¶</a></h5> +<p>The following functions can be used to retrieve the date/time at the time where the function is invoked:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="58%" /> +<col width="42%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Function name</th> +<th class="head">Output type</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">currentTimestamp</span></code></td> +<td><code class="docutils literal"><span class="pre">timestamp</span></code></td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">currentDate</span></code></td> +<td><code class="docutils literal"><span class="pre">date</span></code></td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">currentTime</span></code></td> +<td><code class="docutils literal"><span class="pre">time</span></code></td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">currentTimeUUID</span></code></td> +<td><code class="docutils literal"><span class="pre">timeUUID</span></code></td> +</tr> +</tbody> +</table> +<p>For example the last 2 days of data can be retrieved using:</p> +<div class="highlight-cql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">myTable</span> <span class="k">WHERE</span> <span class="nb">date</span> <span class="o">>=</span> <span class="n">currentDate</span><span class="p">()</span> <span class="o">-</span> <span class="mf">2</span><span class="n">d</span> +</pre></div> +</div> +</div> <div class="section" id="time-conversion-functions"> -<h4>Time conversion functions<a class="headerlink" href="#time-conversion-functions" title="Permalink to this headline">¶</a></h4> +<h5>Time conversion functions<a class="headerlink" href="#time-conversion-functions" title="Permalink to this headline">¶</a></h5> <p>A number of functions are provided to âconvertâ a <code class="docutils literal"><span class="pre">timeuuid</span></code>, a <code class="docutils literal"><span class="pre">timestamp</span></code> or a <code class="docutils literal"><span class="pre">date</span></code> into another <code class="docutils literal"><span class="pre">native</span></code> type.</p> <table border="1" class="docutils"> @@ -325,6 +362,7 @@ type.</p> </tbody> </table> </div> +</div> <div class="section" id="blob-conversion-functions"> <h4>Blob conversion functions<a class="headerlink" href="#blob-conversion-functions" title="Permalink to this headline">¶</a></h4> <p>A number of functions are provided to âconvertâ the native types into binary data (<code class="docutils literal"><span class="pre">blob</span></code>). For every @@ -652,7 +690,7 @@ function with the signature does not exi <div class="doc-prev-next-links" role="navigation" aria-label="footer navigation"> - <a href="json.html" class="btn btn-default pull-right " role="button" title="JSON Support" accesskey="n">Next <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span></a> + <a href="operators.html" class="btn btn-default pull-right " role="button" title="Arithmetic Operators" accesskey="n">Next <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span></a> <a href="security.html" class="btn btn-default" role="button" title="Security" accesskey="p"><span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span> Previous</a> Modified: cassandra/site/src/doc/4.0/cql/index.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/index.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/index.html (original) +++ cassandra/site/src/doc/4.0/cql/index.html Tue May 16 02:01:22 2017 @@ -65,6 +65,7 @@ extra-footer: ' <li class="toctree-l2"><a class="reference internal" href="mvs.html">Materialized Views</a></li> <li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> <li class="toctree-l2"><a class="reference internal" href="triggers.html">Triggers</a></li> <li class="toctree-l2"><a class="reference internal" href="appendices.html">Appendices</a></li> @@ -75,7 +76,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> @@ -97,8 +98,7 @@ extra-footer: ' the languages. However, the <a class="reference external" href="#changes">changes</a> section provides the diff between the different versions of CQL.</p> <p>CQL offers a model 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 deprecated -thrift API (and earlier version 1 and 2 of CQL).</p> +in SQL.</p> <div class="toctree-wrapper compound"> <ul> <li class="toctree-l1"><a class="reference internal" href="definitions.html">Definitions</a><ul> @@ -116,6 +116,7 @@ thrift API (and earlier version 1 and 2 <li class="toctree-l2"><a class="reference internal" href="types.html#working-with-timestamps">Working with timestamps</a></li> <li class="toctree-l2"><a class="reference internal" href="types.html#working-with-dates">Working with dates</a></li> <li class="toctree-l2"><a class="reference internal" href="types.html#working-with-times">Working with times</a></li> +<li class="toctree-l2"><a class="reference internal" href="types.html#working-with-durations">Working with durations</a></li> <li class="toctree-l2"><a class="reference internal" href="types.html#collections">Collections</a></li> <li class="toctree-l2"><a class="reference internal" href="types.html#user-defined-types">User-Defined Types</a></li> <li class="toctree-l2"><a class="reference internal" href="types.html#tuples">Tuples</a></li> @@ -164,6 +165,11 @@ thrift API (and earlier version 1 and 2 <li class="toctree-l2"><a class="reference internal" href="functions.html#aggregate-functions">Aggregate functions</a></li> </ul> </li> +<li class="toctree-l1"><a class="reference internal" href="operators.html">Arithmetic Operators</a><ul> +<li class="toctree-l2"><a class="reference internal" href="operators.html#id2">Number Arithmetic</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html#id4">Datetime Arithmetic</a></li> +</ul> +</li> <li class="toctree-l1"><a class="reference internal" href="json.html">JSON Support</a><ul> <li class="toctree-l2"><a class="reference internal" href="json.html#select-json">SELECT JSON</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html#insert-json">INSERT JSON</a></li> @@ -183,26 +189,28 @@ thrift API (and earlier version 1 and 2 </ul> </li> <li class="toctree-l1"><a class="reference internal" href="changes.html">Changes</a><ul> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id1">3.4.3</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id2">3.4.2</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id3">3.4.1</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id4">3.4.0</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id5">3.3.1</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id6">3.3.0</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id7">3.2.0</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id8">3.1.7</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id9">3.1.6</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id10">3.1.5</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id11">3.1.4</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id12">3.1.3</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id13">3.1.2</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id14">3.1.1</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id15">3.1.0</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id16">3.0.5</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id17">3.0.4</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id18">3.0.3</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id19">3.0.2</a></li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#id20">3.0.1</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id1">3.4.5</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id2">3.4.4</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id3">3.4.3</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id6">3.4.2</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id7">3.4.1</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id8">3.4.0</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id9">3.3.1</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id10">3.3.0</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id11">3.2.0</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id12">3.1.7</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id13">3.1.6</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id14">3.1.5</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id15">3.1.4</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id16">3.1.3</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id17">3.1.2</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id18">3.1.1</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id19">3.1.0</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id20">3.0.5</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id21">3.0.4</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id22">3.0.3</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id23">3.0.2</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html#id24">3.0.1</a></li> <li class="toctree-l2"><a class="reference internal" href="changes.html#versioning">Versioning</a></li> </ul> </li> Modified: cassandra/site/src/doc/4.0/cql/indexes.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/indexes.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/indexes.html (original) +++ cassandra/site/src/doc/4.0/cql/indexes.html Tue May 16 02:01:22 2017 @@ -72,6 +72,7 @@ extra-footer: ' <li class="toctree-l2"><a class="reference internal" href="mvs.html">Materialized Views</a></li> <li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> <li class="toctree-l2"><a class="reference internal" href="triggers.html">Triggers</a></li> <li class="toctree-l2"><a class="reference internal" href="appendices.html">Appendices</a></li> @@ -82,7 +83,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> Modified: cassandra/site/src/doc/4.0/cql/json.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/json.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/json.html (original) +++ cassandra/site/src/doc/4.0/cql/json.html Tue May 16 02:01:22 2017 @@ -13,7 +13,7 @@ doc-header-links: ' <link rel="top" title="Apache Cassandra Documentation v4.0" href="../index.html"/> <link rel="up" title="The Cassandra Query Language (CQL)" href="index.html"/> <link rel="next" title="Triggers" href="triggers.html"/> - <link rel="prev" title="Functions" href="functions.html"/> + <link rel="prev" title="Arithmetic Operators" href="operators.html"/> ' doc-search-path: "../search.html" @@ -68,6 +68,7 @@ extra-footer: ' <li class="toctree-l2"><a class="reference internal" href="mvs.html">Materialized Views</a></li> <li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">JSON Support</a><ul> <li class="toctree-l3"><a class="reference internal" href="#select-json">SELECT JSON</a></li> <li class="toctree-l3"><a class="reference internal" href="#insert-json">INSERT JSON</a></li> @@ -85,7 +86,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> @@ -304,7 +305,7 @@ in the selection clause of a <code class <a href="triggers.html" class="btn btn-default pull-right " role="button" title="Triggers" accesskey="n">Next <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span></a> - <a href="functions.html" class="btn btn-default" role="button" title="Functions" accesskey="p"><span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span> Previous</a> + <a href="operators.html" class="btn btn-default" role="button" title="Arithmetic Operators" accesskey="p"><span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span> Previous</a> </div> Modified: cassandra/site/src/doc/4.0/cql/mvs.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/mvs.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/mvs.html (original) +++ cassandra/site/src/doc/4.0/cql/mvs.html Tue May 16 02:01:22 2017 @@ -73,6 +73,7 @@ extra-footer: ' </li> <li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> <li class="toctree-l2"><a class="reference internal" href="triggers.html">Triggers</a></li> <li class="toctree-l2"><a class="reference internal" href="appendices.html">Appendices</a></li> @@ -83,7 +84,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> Added: cassandra/site/src/doc/4.0/cql/operators.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/operators.html?rev=1795259&view=auto ============================================================================== --- cassandra/site/src/doc/4.0/cql/operators.html (added) +++ cassandra/site/src/doc/4.0/cql/operators.html Tue May 16 02:01:22 2017 @@ -0,0 +1,301 @@ +--- +layout: docpage + +title: "Documentation" + +is_homepage: false +is_sphinx_doc: true + +doc-parent: "The Cassandra Query Language (CQL)" + +doc-title: "Arithmetic Operators" +doc-header-links: ' + <link rel="top" title="Apache Cassandra Documentation v4.0" href="../index.html"/> + <link rel="up" title="The Cassandra Query Language (CQL)" href="index.html"/> + <link rel="next" title="JSON Support" href="json.html"/> + <link rel="prev" title="Functions" href="functions.html"/> +' +doc-search-path: "../search.html" + +extra-footer: ' +<script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: "", + VERSION: "", + COLLAPSE_INDEX: false, + FILE_SUFFIX: ".html", + HAS_SOURCE: false, + SOURCELINK_SUFFIX: "" + }; +</script> +' + +--- +<div class="container-fluid"> + <div class="row"> + <div class="col-md-2"> + <div class="doc-navigation"> + <div class="doc-menu" role="navigation"> + <div class="navbar-header"> + <button type="button" class="pull-left navbar-toggle" data-toggle="collapse" data-target=".sidebar-navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + </div> + <div class="navbar-collapse collapse sidebar-navbar-collapse"> + <form id="doc-search-form" class="navbar-form" action="../search.html" method="get" role="search"> + <div class="form-group"> + <input type="text" size="30" class="form-control input-sm" name="q" placeholder="Search docs"> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </div> + </form> + + + + <ul class="current"> +<li class="toctree-l1"><a class="reference internal" href="../getting_started/index.html">Getting Started</a></li> +<li class="toctree-l1"><a class="reference internal" href="../architecture/index.html">Architecture</a></li> +<li class="toctree-l1"><a class="reference internal" href="../data_modeling/index.html">Data Modeling</a></li> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">The Cassandra Query Language (CQL)</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="definitions.html">Definitions</a></li> +<li class="toctree-l2"><a class="reference internal" href="types.html">Data Types</a></li> +<li class="toctree-l2"><a class="reference internal" href="ddl.html">Data Definition</a></li> +<li class="toctree-l2"><a class="reference internal" href="dml.html">Data Manipulation</a></li> +<li class="toctree-l2"><a class="reference internal" href="indexes.html">Secondary Indexes</a></li> +<li class="toctree-l2"><a class="reference internal" href="mvs.html">Materialized Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Arithmetic Operators</a><ul> +<li class="toctree-l3"><a class="reference internal" href="#id2">Number Arithmetic</a></li> +<li class="toctree-l3"><a class="reference internal" href="#id4">Datetime Arithmetic</a></li> +</ul> +</li> +<li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> +<li class="toctree-l2"><a class="reference internal" href="triggers.html">Triggers</a></li> +<li class="toctree-l2"><a class="reference internal" href="appendices.html">Appendices</a></li> +<li class="toctree-l2"><a class="reference internal" href="changes.html">Changes</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../configuration/index.html">Configuring Cassandra</a></li> +<li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> +<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> +<li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> +<li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> +<li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> +<li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> +</ul> + + + + </div><!--/.nav-collapse --> + </div> + </div> + </div> + <div class="col-md-8"> + <div class="content doc-content"> + <div class="container"> + + <div class="section" id="datetime-arithmetic"> +<span id="number-arithmetic"></span><span id="arithmetic-operators"></span><span id="id1"></span><h1>Arithmetic Operators<a class="headerlink" href="#datetime-arithmetic" title="Permalink to this headline">¶</a></h1> +<p>CQL supports the following operators:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="13%" /> +<col width="87%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Operator</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td>- (unary)</td> +<td>Negates operand</td> +</tr> +<tr class="row-odd"><td>+</td> +<td>Addition</td> +</tr> +<tr class="row-even"><td>-</td> +<td>Substraction</td> +</tr> +<tr class="row-odd"><td>*</td> +<td>Multiplication</td> +</tr> +<tr class="row-even"><td>/</td> +<td>Division</td> +</tr> +<tr class="row-odd"><td>%</td> +<td>Returns the remainder of a division</td> +</tr> +</tbody> +</table> +<div class="section" id="id2"> +<span id="id3"></span><h2>Number Arithmetic<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2> +<p>All arithmetic operations are supported on numeric types or counters.</p> +<p>The return type of the operation will be based on the operand types:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="13%" /> +<col width="11%" /> +<col width="10%" /> +<col width="10%" /> +<col width="10%" /> +<col width="10%" /> +<col width="10%" /> +<col width="10%" /> +<col width="10%" /> +<col width="10%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">left/right</th> +<th class="head">tinyint</th> +<th class="head">smallint</th> +<th class="head">int</th> +<th class="head">bigint</th> +<th class="head">counter</th> +<th class="head">float</th> +<th class="head">double</th> +<th class="head">varint</th> +<th class="head">decimal</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><strong>tinyint</strong></td> +<td>tinyint</td> +<td>smallint</td> +<td>int</td> +<td>bigint</td> +<td>bigint</td> +<td>float</td> +<td>double</td> +<td>varint</td> +<td>decimal</td> +</tr> +<tr class="row-odd"><td><strong>smallint</strong></td> +<td>smallint</td> +<td>smallint</td> +<td>int</td> +<td>bigint</td> +<td>bigint</td> +<td>float</td> +<td>double</td> +<td>varint</td> +<td>decimal</td> +</tr> +<tr class="row-even"><td><strong>int</strong></td> +<td>int</td> +<td>int</td> +<td>int</td> +<td>bigint</td> +<td>bigint</td> +<td>float</td> +<td>double</td> +<td>varint</td> +<td>decimal</td> +</tr> +<tr class="row-odd"><td><strong>bigint</strong></td> +<td>bigint</td> +<td>bigint</td> +<td>bigint</td> +<td>bigint</td> +<td>bigint</td> +<td>double</td> +<td>double</td> +<td>varint</td> +<td>decimal</td> +</tr> +<tr class="row-even"><td><strong>counter</strong></td> +<td>bigint</td> +<td>bigint</td> +<td>bigint</td> +<td>bigint</td> +<td>bigint</td> +<td>double</td> +<td>double</td> +<td>varint</td> +<td>decimal</td> +</tr> +<tr class="row-odd"><td><strong>float</strong></td> +<td>float</td> +<td>float</td> +<td>float</td> +<td>double</td> +<td>double</td> +<td>float</td> +<td>double</td> +<td>decimal</td> +<td>decimal</td> +</tr> +<tr class="row-even"><td><strong>double</strong></td> +<td>double</td> +<td>double</td> +<td>double</td> +<td>double</td> +<td>double</td> +<td>double</td> +<td>double</td> +<td>decimal</td> +<td>decimal</td> +</tr> +<tr class="row-odd"><td><strong>varint</strong></td> +<td>varint</td> +<td>varint</td> +<td>varint</td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +</tr> +<tr class="row-even"><td><strong>decimal</strong></td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +<td>decimal</td> +</tr> +</tbody> +</table> +<p><code class="docutils literal"><span class="pre">*</span></code>, <code class="docutils literal"><span class="pre">/</span></code> and <code class="docutils literal"><span class="pre">%</span></code> operators have a higher precedence level than <code class="docutils literal"><span class="pre">+</span></code> and <code class="docutils literal"><span class="pre">-</span></code> operator. By consequence, +they will be evaluated before. If two operator in an expression have the same precedence level, they will be evaluated +left to right based on their position in the expression.</p> +</div> +<div class="section" id="id4"> +<span id="id5"></span><h2>Datetime Arithmetic<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2> +<p>A <code class="docutils literal"><span class="pre">duration</span></code> can be added (+) or substracted (-) from a <code class="docutils literal"><span class="pre">timestamp</span></code> or a <code class="docutils literal"><span class="pre">date</span></code> to create a new +<code class="docutils literal"><span class="pre">timestamp</span></code> or <code class="docutils literal"><span class="pre">date</span></code>. So for instance:</p> +<div class="highlight-cql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">myTable</span> <span class="k">WHERE</span> <span class="n">t</span> <span class="o">=</span> <span class="s1">'2017-01-01'</span> <span class="o">-</span> <span class="mf">2</span><span class="n">d</span> +</pre></div> +</div> +<p>will select all the records with a value of <code class="docutils literal"><span class="pre">t</span></code> which is in the last 2 days of 2016.</p> +</div> +</div> + + + + + <div class="doc-prev-next-links" role="navigation" aria-label="footer navigation"> + + <a href="json.html" class="btn btn-default pull-right " role="button" title="JSON Support" accesskey="n">Next <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span></a> + + + <a href="functions.html" class="btn btn-default" role="button" title="Functions" accesskey="p"><span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span> Previous</a> + + </div> + + </div> + </div> + </div> + <div class="col-md-2"> + </div> + </div> +</div> \ No newline at end of file Modified: cassandra/site/src/doc/4.0/cql/security.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/security.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/security.html (original) +++ cassandra/site/src/doc/4.0/cql/security.html Tue May 16 02:01:22 2017 @@ -73,6 +73,7 @@ extra-footer: ' </ul> </li> <li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> <li class="toctree-l2"><a class="reference internal" href="triggers.html">Triggers</a></li> <li class="toctree-l2"><a class="reference internal" href="appendices.html">Appendices</a></li> @@ -83,7 +84,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> Modified: cassandra/site/src/doc/4.0/cql/triggers.html URL: http://svn.apache.org/viewvc/cassandra/site/src/doc/4.0/cql/triggers.html?rev=1795259&r1=1795258&r2=1795259&view=diff ============================================================================== --- cassandra/site/src/doc/4.0/cql/triggers.html (original) +++ cassandra/site/src/doc/4.0/cql/triggers.html Tue May 16 02:01:22 2017 @@ -68,6 +68,7 @@ extra-footer: ' <li class="toctree-l2"><a class="reference internal" href="mvs.html">Materialized Views</a></li> <li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="functions.html">Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="operators.html">Arithmetic Operators</a></li> <li class="toctree-l2"><a class="reference internal" href="json.html">JSON Support</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">Triggers</a><ul> <li class="toctree-l3"><a class="reference internal" href="#create-trigger">CREATE TRIGGER</a></li> @@ -82,7 +83,7 @@ extra-footer: ' <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> -<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> +<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
