Page MenuHomePhabricator
Paste P6840

Masterwork From Distant Lands
ActivePublic

Authored by Eevans on Mar 12 2018, 9:34 PM.
Tags
None
Referenced Files
F15214423: Masterwork From Distant Lands
Mar 12 2018, 9:34 PM
Subscribers
None
diff -u cassandra-2.2.6/debian/changelog cassandra-2.2.6/debian/changelog
--- cassandra-2.2.6/debian/changelog
+++ cassandra-2.2.6/debian/changelog
@@ -1,3 +1,9 @@
+cassandra (2.2.6-wmf3) unstable; urgency=medium
+
+ * Comment out JVM test invocation that blocks start up.
+
+ -- Eric Evans <eevans@wikimedia.org> Mon, 12 Mar 2018 11:06:06 -0500
+
cassandra (2.2.6-wmf2) unstable; urgency=medium
* Backported https://issues.apache.org/jira/browse/CASSANDRA-11752,
only in patch2:
unchanged:
--- cassandra-2.2.6.orig/README.wmf.md
+++ cassandra-2.2.6/README.wmf.md
@@ -0,0 +1,57 @@
+Building Cassandra for Wikimedia
+================================
+
+### Cleanup any locally generated cruft
+
+ $ rm -rf logs/ data/
+
+### Create a release artifact in the expected format
+
+ $ VERSION=2.2.6
+ $ git archive --format=tar --prefix=cassandra-$VERSION/ \
+ <treeish> | gzip > ../cassandra_$VERSION.orig.tar.gz
+
+### Build a Debian package
+
+ $ dpkg-buildpackage -rfakeroot -us -uc -i'\.git.*'
+
+Delta to 2.2.6 (release)
+-------------------------
+
+ commit c4dda2525fbe3c1f6f29fea8afa5bb6249d24070
+ Author: Eric Evans <eevans@wikimedia.org>
+ Date: Mon Mar 12 13:17:47 2018 -0500
+
+ prompt compiler to use utf-8 source encoding
+
+ commit feb033b34195ad993b57ad5192dec4471fb58aa4
+ Author: Eric Evans <eevans@wikimedia.org>
+ Date: Mon Mar 12 11:07:21 2018 -0500
+
+ Update for 2.2.6-wmf3 Debian package release
+
+ commit 3a5687f3d67240e0f6f260d9802b53ee52632e79
+ Author: Eric Evans <eevans@wikimedia.org>
+ Date: Mon Mar 12 10:57:37 2018 -0500
+
+ comment out startup test
+
+ https://issues.apache.org/jira/browse/CASSANDRA-7254 added a pre-start
+ invocation of the JVM that blocks when using the Prometheus JMX exporter. This
+ patch comments out this invocation, since the condition the test checks for
+ should not be a problem in our environment.
+
+ Bug: T186567
+
+ commit 9e94b97694c36d85ffc86e6ef00043758252df0f
+ Author: Eric Evans <eevans@wikimedia.org>
+ Date: Mon Mar 12 10:49:04 2018 -0500
+
+ import WMF build (2.2.6-wmf2)
+
+ commit e892e3e3ba1b687222915f1c4f523bb7d212d63f
+ Author: Eric Evans <eevans@wikimedia.org>
+ Date: Mon Mar 12 10:51:54 2018 -0500
+
+ README.wmf.md
+
only in patch2:
unchanged:
--- cassandra-2.2.6.orig/build.xml
+++ cassandra-2.2.6/build.xml
@@ -798,6 +798,7 @@
<src path="${build.src.gen-java}"/>
<compilerarg value="-XDignore.symbol.file"/>
<compilerarg value="-Xbootclasspath/p:${build.src.jdkoverride}"/>
+ <compilerarg line="-encoding utf-8"/>
<classpath refid="cassandra.classpath"/>
</javac>
<antcall target="createVersionPropFile"/>
@@ -1156,7 +1157,8 @@
<classpath>
<path refid="cassandra.classpath"/>
</classpath>
- <compilerarg value="-XDignore.symbol.file"/>
+ <compilerarg value="-XDignore.symbol.file"/>
+ <compilerarg line="-encoding utf-8"/>
<src path="${test.unit.src}"/>
<src path="${test.long.src}"/>
<src path="${test.burn.src}"/>
only in patch2:
unchanged:
--- cassandra-2.2.6.orig/debian/patches/110remove_cassandra-7254_test.dpatch
+++ cassandra-2.2.6/debian/patches/110remove_cassandra-7254_test.dpatch
@@ -0,0 +1,31 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 110remove_cassandra-7254_test.dpatch by Eric Evans <eevans@wikimedia.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff --git a/bin/cassandra b/bin/cassandra
+index c968c35636..f5d87f4f4f 100755
+--- a/bin/cassandra
++++ b/bin/cassandra
+@@ -257,12 +257,13 @@ while true; do
+ esac
+ done
+
+-# see CASSANDRA-7254
+-"$JAVA" -cp "$CLASSPATH" $JVM_OPTS 2>&1 | grep -q 'Error: Exception thrown by the agent : java.lang.NullPointerException'
+-if [ $? -ne "1" ]; then
+- echo Unable to bind JMX, is Cassandra already running?
+- exit 1;
+-fi
++# Blocks startup when using the Prometheus exporter agent (see: T186567)
++# # see CASSANDRA-7254
++# "$JAVA" -cp "$CLASSPATH" $JVM_OPTS 2>&1 | grep -q 'Error: Exception thrown by the agent : java.lang.NullPointerException'
++# if [ $? -ne "1" ]; then
++# echo Unable to bind JMX, is Cassandra already running?
++# exit 1;
++# fi
+
+ # Start up the service
+ launch_service "$pidfile" "$foreground" "$properties" "$classname"
only in patch2:
unchanged:
--- cassandra-2.2.6.orig/doc/cql3/CQL.html
+++ cassandra-2.2.6/doc/cql3/CQL.html
@@ -644,4 +644,4 @@
INSERT INTO atable (pk, val) VALUES (4,4);
SELECT average(val) FROM atable;
</pre></pre><p></p><p>See <a href="#createAggregateStmt"><code>CREATE AGGREGATE</code></a> and <a href="#dropAggregateStmt"><code>DROP AGGREGATE</code></a>.</p><h2 id="json">JSON Support</h2><p>Cassandra 2.2 introduces JSON support to <a href="#selectStmt"><code>SELECT</code></a> and <a href="#insertStmt"><code>INSERT</code></a> statements. This support does not fundamentally alter the CQL API (for example, the schema is still enforced), it simply provides a convenient way to work with JSON documents.</p><h3 id="selectJson">SELECT JSON</h3><p>With <code>SELECT</code> statements, the new <code>JSON</code> keyword can be used to return each row as a single <code>JSON</code> encoded map. The remainder of the <code>SELECT</code> statment behavior is the same.</p><p>The result map keys are the same as the column names in a normal result set. For example, a statement like "<code>SELECT JSON a, ttl(b) FROM ...</code>" would result in a map with keys <code>"a"</code> and <code>"ttl(b)"</code>. However, this is one notable exception: for symmetry with <code>INSERT JSON</code> behavior, case-sensitive column names with upper-case letters will be surrounded with double quotes. For example, "<code>SELECT JSON myColumn FROM ...</code>" would result in a map key <code>"\"myColumn\""</code> (note the escaped quotes).</p><p>The map values will <code>JSON</code>-encoded representations (as described below) of the result set values.</p><h3 id="insertJson">INSERT JSON</h3><p>With <code>INSERT</code> statements, the new <code>JSON</code> keyword can be used to enable inserting a <code>JSON</code> encoded map as a single row. The format of the <code>JSON</code> map should generally match that returned by a <code>SELECT JSON</code> statement on the same table. In particular, case-sensitive column names should be surrounded with double quotes. For example, to insert into a table with two columns named &#8220;myKey&#8221; and &#8220;value&#8221;, you would do the following:</p><pre class="sample"><pre>INSERT INTO mytable JSON '{"\"myKey\"": 0, "value": 0}'
-</pre></pre><p>Any columns which are ommitted from the <code>JSON</code> map will be defaulted to a <code>NULL</code> value (which will result in a tombstone being created).</p><h3 id="jsonEncoding">JSON Encoding of Cassandra Data Types</h3><p>Where possible, Cassandra will represent and accept data types in their native <code>JSON</code> representation. Cassandra will also accept string representations matching the CQL literal format for all single-field types. For example, floats, ints, UUIDs, and dates can be represented by CQL literal strings. However, compound types, such as collections, tuples, and user-defined types must be represented by native <code>JSON</code> collections (maps and lists) or a JSON-encoded string representation of the collection.</p><p>The following table describes the encodings that Cassandra will accept in <code>INSERT JSON</code> values (and <code>fromJson()</code> arguments) as well as the format Cassandra will use when returning data for <code>SELECT JSON</code> statements (and <code>fromJson()</code>):</p><table><tr><th>type </th><th>formats accepted </th><th>return format </th><th>notes</th></tr><tr><td><code>ascii</code> </td><td>string </td><td>string </td><td>Uses JSON&#8217;s <code>\u</code> character escape</td></tr><tr><td><code>bigint</code> </td><td>integer, string </td><td>integer </td><td>String must be valid 64 bit integer</td></tr><tr><td><code>blob</code> </td><td>string </td><td>string </td><td>String should be 0x followed by an even number of hex digits</td></tr><tr><td><code>boolean</code> </td><td>boolean, string </td><td>boolean </td><td>String must be &#8220;true&#8221; or "false"</td></tr><tr><td><code>date</code> </td><td>string </td><td>string </td><td>Date in format <code>YYYY-MM-DD</code>, timezone UTC</td></tr><tr><td><code>decimal</code> </td><td>integer, float, string</td><td>float </td><td>May exceed 32 or 64-bit IEEE-754 floating point precision in client-side decoder</td></tr><tr><td><code>double</code> </td><td>integer, float, string</td><td>float </td><td>String must be valid integer or float</td></tr><tr><td><code>float</code> </td><td>integer, float, string</td><td>float </td><td>String must be valid integer or float</td></tr><tr><td><code>inet</code> </td><td>string </td><td>string </td><td>IPv4 or IPv6 address</td></tr><tr><td><code>int</code> </td><td>integer, string </td><td>integer </td><td>String must be valid 32 bit integer</td></tr><tr><td><code>list</code> </td><td>list, string </td><td>list </td><td>Uses JSON&#8217;s native list representation</td></tr><tr><td><code>map</code> </td><td>map, string </td><td>map </td><td>Uses JSON&#8217;s native map representation</td></tr><tr><td><code>smallint</code> </td><td>integer, string </td><td>integer </td><td>String must be valid 16 bit integer</td></tr><tr><td><code>set</code> </td><td>list, string </td><td>list </td><td>Uses JSON&#8217;s native list representation</td></tr><tr><td><code>text</code> </td><td>string </td><td>string </td><td>Uses JSON&#8217;s <code>\u</code> character escape</td></tr><tr><td><code>time</code> </td><td>string </td><td>string </td><td>Time of day in format <code>HH-MM-SS[.fffffffff]</code></td></tr><tr><td><code>timestamp</code></td><td>integer, string </td><td>string </td><td>A timestamp. Strings constant are allow to input timestamps as dates, see <a href="#usingdates">Working with dates</a> below for more information. Datestamps with format <code>YYYY-MM-DD HH:MM:SS.SSS</code> are returned.</td></tr><tr><td><code>timeuuid</code> </td><td>string </td><td>string </td><td>Type 1 UUID. See <a href="#constants">Constants</a> for the UUID format</td></tr><tr><td><code>tinyint</code> </td><td>integer, string </td><td>integer </td><td>String must be valid 8 bit integer</td></tr><tr><td><code>tuple</code> </td><td>list, string </td><td>list </td><td>Uses JSON&#8217;s native list representation</td></tr><tr><td><code>UDT</code> </td><td>map, string </td><td>map </td><td>Uses JSON&#8217;s native map representation with field names as keys</td></tr><tr><td><code>uuid</code> </td><td>string </td><td>string </td><td>See <a href="#constants">Constants</a> for the UUID format</td></tr><tr><td><code>varchar</code> </td><td>string </td><td>string </td><td>Uses JSON&#8217;s <code>\u</code> character escape</td></tr><tr><td><code>varint</code> </td><td>integer, string </td><td>integer </td><td>Variable length; may overflow 32 or 64 bit integers in client-side decoder</td></tr></table><h3 id="fromJson">The fromJson() Function</h3><p>The <code>fromJson()</code> function may be used similarly to <code>INSERT JSON</code>, but for a single column value. It may only be used in the <code>VALUES</code> clause of an <code>INSERT</code> statement or as one of the column values in an <code>UPDATE</code>, <code>DELETE</code>, or <code>SELECT</code> statement. For example, it cannot be used in the selection clause of a <code>SELECT</code> statement.</p><h3 id="toJson">The toJson() Function</h3><p>The <code>toJson()</code> function may be used similarly to <code>SELECT JSON</code>, but for a single column value. It may only be used in the selection clause of a <code>SELECT</code> statement.</p><h2 id="appendixA">Appendix A: CQL Keywords</h2><p>CQL distinguishes between <em>reserved</em> and <em>non-reserved</em> keywords. Reserved keywords cannot be used as identifier, they are truly reserved for the language (but one can enclose a reserved keyword by double-quotes to use it as an identifier). Non-reserved keywords however only have a specific meaning in certain context but can used as identifer otherwise. The only <em>raison d'être</em> of these non-reserved keywords is convenience: some keyword are non-reserved when it was always easy for the parser to decide whether they were used as keywords or not.</p><table><tr><th>Keyword </th><th>Reserved? </th></tr><tr><td><code>ADD</code> </td><td>yes </td></tr><tr><td><code>AGGREGATE</code> </td><td>no </td></tr><tr><td><code>ALL</code> </td><td>no </td></tr><tr><td><code>ALLOW</code> </td><td>yes </td></tr><tr><td><code>ALTER</code> </td><td>yes </td></tr><tr><td><code>AND</code> </td><td>yes </td></tr><tr><td><code>APPLY</code> </td><td>yes </td></tr><tr><td><code>AS</code> </td><td>no </td></tr><tr><td><code>ASC</code> </td><td>yes </td></tr><tr><td><code>ASCII</code> </td><td>no </td></tr><tr><td><code>AUTHORIZE</code> </td><td>yes </td></tr><tr><td><code>BATCH</code> </td><td>yes </td></tr><tr><td><code>BEGIN</code> </td><td>yes </td></tr><tr><td><code>BIGINT</code> </td><td>no </td></tr><tr><td><code>BLOB</code> </td><td>no </td></tr><tr><td><code>BOOLEAN</code> </td><td>no </td></tr><tr><td><code>BY</code> </td><td>yes </td></tr><tr><td><code>CALLED</code> </td><td>no </td></tr><tr><td><code>CLUSTERING</code> </td><td>no </td></tr><tr><td><code>COLUMNFAMILY</code> </td><td>yes </td></tr><tr><td><code>COMPACT</code> </td><td>no </td></tr><tr><td><code>CONTAINS</code> </td><td>no </td></tr><tr><td><code>COUNT</code> </td><td>no </td></tr><tr><td><code>COUNTER</code> </td><td>no </td></tr><tr><td><code>CREATE</code> </td><td>yes </td></tr><tr><td><code>CUSTOM</code> </td><td>no </td></tr><tr><td><code>DATE</code> </td><td>no </td></tr><tr><td><code>DECIMAL</code> </td><td>no </td></tr><tr><td><code>DELETE</code> </td><td>yes </td></tr><tr><td><code>DESC</code> </td><td>yes </td></tr><tr><td><code>DESCRIBE</code> </td><td>yes </td></tr><tr><td><code>DISTINCT</code> </td><td>no </td></tr><tr><td><code>DOUBLE</code> </td><td>no </td></tr><tr><td><code>DROP</code> </td><td>yes </td></tr><tr><td><code>ENTRIES</code> </td><td>yes </td></tr><tr><td><code>EXECUTE</code> </td><td>yes </td></tr><tr><td><code>EXISTS</code> </td><td>no </td></tr><tr><td><code>FILTERING</code> </td><td>no </td></tr><tr><td><code>FINALFUNC</code> </td><td>no </td></tr><tr><td><code>FLOAT</code> </td><td>no </td></tr><tr><td><code>FROM</code> </td><td>yes </td></tr><tr><td><code>FROZEN</code> </td><td>no </td></tr><tr><td><code>FULL</code> </td><td>yes </td></tr><tr><td><code>FUNCTION</code> </td><td>no </td></tr><tr><td><code>FUNCTIONS</code> </td><td>no </td></tr><tr><td><code>GRANT</code> </td><td>yes </td></tr><tr><td><code>IF</code> </td><td>yes </td></tr><tr><td><code>IN</code> </td><td>yes </td></tr><tr><td><code>INDEX</code> </td><td>yes </td></tr><tr><td><code>INET</code> </td><td>no </td></tr><tr><td><code>INFINITY</code> </td><td>yes </td></tr><tr><td><code>INITCOND</code> </td><td>no </td></tr><tr><td><code>INPUT</code> </td><td>no </td></tr><tr><td><code>INSERT</code> </td><td>yes </td></tr><tr><td><code>INT</code> </td><td>no </td></tr><tr><td><code>INTO</code> </td><td>yes </td></tr><tr><td><code>JSON</code> </td><td>no </td></tr><tr><td><code>KEY</code> </td><td>no </td></tr><tr><td><code>KEYS</code> </td><td>no </td></tr><tr><td><code>KEYSPACE</code> </td><td>yes </td></tr><tr><td><code>KEYSPACES</code> </td><td>no </td></tr><tr><td><code>LANGUAGE</code> </td><td>no </td></tr><tr><td><code>LIMIT</code> </td><td>yes </td></tr><tr><td><code>LIST</code> </td><td>no </td></tr><tr><td><code>LOGIN</code> </td><td>no </td></tr><tr><td><code>MAP</code> </td><td>no </td></tr><tr><td><code>MODIFY</code> </td><td>yes </td></tr><tr><td><code>NAN</code> </td><td>yes </td></tr><tr><td><code>NOLOGIN</code> </td><td>no </td></tr><tr><td><code>NORECURSIVE</code> </td><td>yes </td></tr><tr><td><code>NOSUPERUSER</code> </td><td>no </td></tr><tr><td><code>NOT</code> </td><td>yes </td></tr><tr><td><code>NULL</code> </td><td>yes </td></tr><tr><td><code>OF</code> </td><td>yes </td></tr><tr><td><code>ON</code> </td><td>yes </td></tr><tr><td><code>OPTIONS</code> </td><td>no </td></tr><tr><td><code>OR</code> </td><td>yes </td></tr><tr><td><code>ORDER</code> </td><td>yes </td></tr><tr><td><code>PASSWORD</code> </td><td>no </td></tr><tr><td><code>PERMISSION</code> </td><td>no </td></tr><tr><td><code>PERMISSIONS</code> </td><td>no </td></tr><tr><td><code>PRIMARY</code> </td><td>yes </td></tr><tr><td><code>RENAME</code> </td><td>yes </td></tr><tr><td><code>REPLACE</code> </td><td>yes </td></tr><tr><td><code>RETURNS</code> </td><td>no </td></tr><tr><td><code>REVOKE</code> </td><td>yes </td></tr><tr><td><code>ROLE</code> </td><td>no </td></tr><tr><td><code>ROLES</code> </td><td>no </td></tr><tr><td><code>SCHEMA</code> </td><td>yes </td></tr><tr><td><code>SELECT</code> </td><td>yes </td></tr><tr><td><code>SET</code> </td><td>yes </td></tr><tr><td><code>SFUNC</code> </td><td>no </td></tr><tr><td><code>SMALLINT</code> </td><td>no </td></tr><tr><td><code>STATIC</code> </td><td>no </td></tr><tr><td><code>STORAGE</code> </td><td>no </td></tr><tr><td><code>STYPE</code> </td><td>no </td></tr><tr><td><code>SUPERUSER</code> </td><td>no </td></tr><tr><td><code>TABLE</code> </td><td>yes </td></tr><tr><td><code>TEXT</code> </td><td>no </td></tr><tr><td><code>TIME</code> </td><td>no </td></tr><tr><td><code>TIMESTAMP</code> </td><td>no </td></tr><tr><td><code>TIMEUUID</code> </td><td>no </td></tr><tr><td><code>TINYINT</code> </td><td>no </td></tr><tr><td><code>TO</code> </td><td>yes </td></tr><tr><td><code>TOKEN</code> </td><td>yes </td></tr><tr><td><code>TRIGGER</code> </td><td>no </td></tr><tr><td><code>TRUNCATE</code> </td><td>yes </td></tr><tr><td><code>TTL</code> </td><td>no </td></tr><tr><td><code>TUPLE</code> </td><td>no </td></tr><tr><td><code>TYPE</code> </td><td>no </td></tr><tr><td><code>UNLOGGED</code> </td><td>yes </td></tr><tr><td><code>UPDATE</code> </td><td>yes </td></tr><tr><td><code>USE</code> </td><td>yes </td></tr><tr><td><code>USER</code> </td><td>no </td></tr><tr><td><code>USERS</code> </td><td>no </td></tr><tr><td><code>USING</code> </td><td>yes </td></tr><tr><td><code>UUID</code> </td><td>no </td></tr><tr><td><code>VALUES</code> </td><td>no </td></tr><tr><td><code>VARCHAR</code> </td><td>no </td></tr><tr><td><code>VARINT</code> </td><td>no </td></tr><tr><td><code>WHERE</code> </td><td>yes </td></tr><tr><td><code>WITH</code> </td><td>yes </td></tr><tr><td><code>WRITETIME</code> </td><td>no </td></tr></table><h2 id="appendixB">Appendix B: CQL Reserved Types</h2><p>The following type names are not currently used by CQL, but are reserved for potential future use. User-defined types may not use reserved type names as their name.</p><table><tr><th>type </th></tr><tr><td><code>bitstring</code> </td></tr><tr><td><code>byte</code> </td></tr><tr><td><code>complex</code> </td></tr><tr><td><code>date</code> </td></tr><tr><td><code>enum</code> </td></tr><tr><td><code>interval</code> </td></tr><tr><td><code>macaddr</code> </td></tr><tr><td><code>smallint</code> </td></tr></table><h2 id="changes">Changes</h2><p>The following describes the changes in each version of CQL.</p><h3 id="a3.3.1">3.3.1</h3><ul><li>The syntax <code>TRUNCATE TABLE X</code> is now accepted as an alias for <code>TRUNCATE X</code></li></ul><h3 id="a3.3.0">3.3.0</h3><ul><li>Adds new <a href="#aggregates">aggregates</a></li><li>User-defined functions are now supported through <a href="#createFunctionStmt"><code>CREATE FUNCTION</code></a> and <a href="#dropFunctionStmt"><code>DROP FUNCTION</code></a>.</li><li>User-defined aggregates are now supported through <a href="#createAggregateStmt"><code>CREATE AGGREGATE</code></a> and <a href="#dropAggregateStmt"><code>DROP AGGREGATE</code></a>.</li><li>Allows double-dollar enclosed strings literals as an alternative to single-quote enclosed strings.</li><li>Introduces Roles to supercede user based authentication and access control</li><li><a href="#usingdates"><code>Date</code></a> and <a href="usingtime"><code>Time</code></a> data types have been added</li><li><a href="#json"><code>JSON</code></a> support has been added</li><li><code>Tinyint</code> and <code>Smallint</code> data types have been added</li><li>Adds new time conversion functions and deprecate <code>dateOf</code> and <code>unixTimestampOf</code>. See <a href="#timeFun"><code>Time conversion functions</code></a></li></ul><h3 id="a3.2.0">3.2.0</h3><ul><li>User-defined types are now supported through <a href="#createTypeStmt"><code>CREATE TYPE</code></a>, <a href="#alterTypeStmt"><code>ALTER TYPE</code></a>, and <a href="#dropTypeStmt"><code>DROP TYPE</code></a></li><li><a href="#createIndexStmt"><code>CREATE INDEX</code></a> now supports indexing collection columns, including indexing the keys of map collections through the <code>keys()</code> function</li><li>Indexes on collections may be queried using the new <code>CONTAINS</code> and <code>CONTAINS KEY</code> operators</li><li>Tuple types were added to hold fixed-length sets of typed positional fields (see the section on <a href="#types">types</a> )</li><li><a href="#dropIndexStmt"><code>DROP INDEX</code></a> now supports optionally specifying a keyspace</li></ul><h3 id="a3.1.7">3.1.7</h3><ul><li><code>SELECT</code> statements now support selecting multiple rows in a single partition using an <code>IN</code> clause on combinations of clustering columns. See <a href="#selectWhere">SELECT WHERE</a> clauses.</li><li><code>IF NOT EXISTS</code> and <code>IF EXISTS</code> syntax is now supported by <code>CREATE USER</code> and <code>DROP USER</code> statmenets, respectively.</li></ul><h3 id="a3.1.6">3.1.6</h3><ul><li>A new <a href="#uuidFun"><code>uuid</code> method</a> has been added.</li><li>Support for <code>DELETE ... IF EXISTS</code> syntax.</li></ul><h3 id="a3.1.5">3.1.5</h3><ul><li>It is now possible to group clustering columns in a relatiion, see <a href="#selectWhere">SELECT WHERE</a> clauses.</li><li>Added support for <code>STATIC</code> columns, see <a href="#createTableStatic">static in CREATE TABLE</a>.</li></ul><h3 id="a3.1.4">3.1.4</h3><ul><li><code>CREATE INDEX</code> now allows specifying options when creating CUSTOM indexes (see <a href="#createIndexStmt">CREATE INDEX reference</a> ).</li></ul><h3 id="a3.1.3">3.1.3</h3><ul><li>Millisecond precision formats have been added to the timestamp parser (see <a href="#usingtimestamps">working with dates</a> ).</li></ul><h3 id="a3.1.2">3.1.2</h3><ul><li><code>NaN</code> and <code>Infinity</code> has been added as valid float contants. They are now reserved keywords. In the unlikely case you we using them as a column identifier (or keyspace/table one), you will noew need to double quote them (see <a href="#identifiers">quote identifiers</a> ).</li></ul><h3 id="a3.1.1">3.1.1</h3><ul><li><code>SELECT</code> statement now allows listing the partition keys (using the <code>DISTINCT</code> modifier). See <a href="https://issues.apache.org/jira/browse/CASSANDRA-4536">CASSANDRA-4536</a>.</li><li>The syntax <code>c IN ?</code> is now supported in <code>WHERE</code> clauses. In that case, the value expected for the bind variable will be a list of whatever type <code>c</code> is.</li><li>It is now possible to use named bind variables (using <code>:name</code> instead of <code>?</code>).</li></ul><h3 id="a3.1.0">3.1.0</h3><ul><li><a href="#alterTableStmt">ALTER TABLE</a> <code>DROP</code> option has been reenabled for CQL3 tables and has new semantics now: the space formerly used by dropped columns will now be eventually reclaimed (post-compaction). You should not readd previously dropped columns unless you use timestamps with microsecond precision (see <a href="https://issues.apache.org/jira/browse/CASSANDRA-3919">CASSANDRA-3919</a> for more details).</li><li><code>SELECT</code> statement now supports aliases in select clause. Aliases in WHERE and ORDER BY clauses are not supported. See the <a href="#selectStmt">section on select</a> for details.</li><li><code>CREATE</code> statements for <code>KEYSPACE</code>, <code>TABLE</code> and <code>INDEX</code> now supports an <code>IF NOT EXISTS</code> condition. Similarly, <code>DROP</code> statements support a <code>IF EXISTS</code> condition.</li><li><code>INSERT</code> statements optionally supports a <code>IF NOT EXISTS</code> condition and <code>UPDATE</code> supports <code>IF</code> conditions.</li></ul><h3 id="a3.0.5">3.0.5</h3><ul><li><code>SELECT</code>, <code>UPDATE</code>, and <code>DELETE</code> statements now allow empty <code>IN</code> relations (see <a href="https://issues.apache.org/jira/browse/CASSANDRA-5626">CASSANDRA-5626</a>).</li></ul><h3 id="a3.0.4">3.0.4</h3><ul><li>Updated the syntax for custom <a href="#createIndexStmt">secondary indexes</a>.</li><li>Non-equal condition on the partition key are now never supported, even for ordering partitioner as this was not correct (the order was <strong>not</strong> the one of the type of the partition key). Instead, the <code>token</code> method should always be used for range queries on the partition key (see <a href="#selectWhere">WHERE clauses</a> ).</li></ul><h3 id="a3.0.3">3.0.3</h3><ul><li>Support for custom <a href="#createIndexStmt">secondary indexes</a> has been added.</li></ul><h3 id="a3.0.2">3.0.2</h3><ul><li>Type validation for the <a href="#constants">constants</a> has been fixed. For instance, the implementation used to allow <code>'2'</code> as a valid value for an <code>int</code> column (interpreting it has the equivalent of <code>2</code>), or <code>42</code> as a valid <code>blob</code> value (in which case <code>42</code> was interpreted as an hexadecimal representation of the blob). This is no longer the case, type validation of constants is now more strict. See the <a href="#types">data types</a> section for details on which constant is allowed for which type.</li><li>The type validation fixed of the previous point has lead to the introduction of <a href="#constants">blobs constants</a> to allow inputing blobs. Do note that while inputing blobs as strings constant is still supported by this version (to allow smoother transition to blob constant), it is now deprecated (in particular the <a href="#types">data types</a> section does not list strings constants as valid blobs) and will be removed by a future version. If you were using strings as blobs, you should thus update your client code ASAP to switch blob constants.</li><li>A number of functions to convert native types to blobs have also been introduced. Furthermore the token function is now also allowed in select clauses. See the <a href="#functions">section on functions</a> for details.</li></ul><h3 id="a3.0.1">3.0.1</h3><ul><li><a href="#usingtimestamps">Date strings</a> (and timestamps) are no longer accepted as valid <code>timeuuid</code> values. Doing so was a bug in the sense that date string are not valid <code>timeuuid</code>, and it was thus resulting in <a href="https://issues.apache.org/jira/browse/CASSANDRA-4936">confusing behaviors</a>. However, the following new methods have been added to help working with <code>timeuuid</code>: <code>now</code>, <code>minTimeuuid</code>, <code>maxTimeuuid</code> , <code>dateOf</code> and <code>unixTimestampOf</code>. See the <a href="#timeuuidFun">section dedicated to these methods</a> for more detail.</li><li>&#8220;Float constants&#8221;#constants now support the exponent notation. In other words, <code>4.2E10</code> is now a valid floating point value.</li></ul><h2 id="Versioning">Versioning</h2><p>Versioning of the CQL language adheres to the <a href="http://semver.org">Semantic Versioning</a> guidelines. Versions take the form X.Y.Z where X, Y, and Z are integer values representing major, minor, and patch level respectively. There is no correlation between Cassandra release versions and the CQL language version.</p><table><tr><th>version</th><th>description</th></tr><tr><td>Major </td><td>The major version <em>must</em> be bumped when backward incompatible changes are introduced. This should rarely occur.</td></tr><tr><td>Minor </td><td>Minor version increments occur when new, but backward compatible, functionality is introduced.</td></tr><tr><td>Patch </td><td>The patch version is incremented when bugs are fixed.</td></tr></table></body></html>
\ No newline at end of file
+</pre></pre><p>Any columns which are ommitted from the <code>JSON</code> map will be defaulted to a <code>NULL</code> value (which will result in a tombstone being created).</p><h3 id="jsonEncoding">JSON Encoding of Cassandra Data Types</h3><p>Where possible, Cassandra will represent and accept data types in their native <code>JSON</code> representation. Cassandra will also accept string representations matching the CQL literal format for all single-field types. For example, floats, ints, UUIDs, and dates can be represented by CQL literal strings. However, compound types, such as collections, tuples, and user-defined types must be represented by native <code>JSON</code> collections (maps and lists) or a JSON-encoded string representation of the collection.</p><p>The following table describes the encodings that Cassandra will accept in <code>INSERT JSON</code> values (and <code>fromJson()</code> arguments) as well as the format Cassandra will use when returning data for <code>SELECT JSON</code> statements (and <code>fromJson()</code>):</p><table><tr><th>type </th><th>formats accepted </th><th>return format </th><th>notes</th></tr><tr><td><code>ascii</code> </td><td>string </td><td>string </td><td>Uses JSON&#8217;s <code>\u</code> character escape</td></tr><tr><td><code>bigint</code> </td><td>integer, string </td><td>integer </td><td>String must be valid 64 bit integer</td></tr><tr><td><code>blob</code> </td><td>string </td><td>string </td><td>String should be 0x followed by an even number of hex digits</td></tr><tr><td><code>boolean</code> </td><td>boolean, string </td><td>boolean </td><td>String must be &#8220;true&#8221; or "false"</td></tr><tr><td><code>date</code> </td><td>string </td><td>string </td><td>Date in format <code>YYYY-MM-DD</code>, timezone UTC</td></tr><tr><td><code>decimal</code> </td><td>integer, float, string</td><td>float </td><td>May exceed 32 or 64-bit IEEE-754 floating point precision in client-side decoder</td></tr><tr><td><code>double</code> </td><td>integer, float, string</td><td>float </td><td>String must be valid integer or float</td></tr><tr><td><code>float</code> </td><td>integer, float, string</td><td>float </td><td>String must be valid integer or float</td></tr><tr><td><code>inet</code> </td><td>string </td><td>string </td><td>IPv4 or IPv6 address</td></tr><tr><td><code>int</code> </td><td>integer, string </td><td>integer </td><td>String must be valid 32 bit integer</td></tr><tr><td><code>list</code> </td><td>list, string </td><td>list </td><td>Uses JSON&#8217;s native list representation</td></tr><tr><td><code>map</code> </td><td>map, string </td><td>map </td><td>Uses JSON&#8217;s native map representation</td></tr><tr><td><code>smallint</code> </td><td>integer, string </td><td>integer </td><td>String must be valid 16 bit integer</td></tr><tr><td><code>set</code> </td><td>list, string </td><td>list </td><td>Uses JSON&#8217;s native list representation</td></tr><tr><td><code>text</code> </td><td>string </td><td>string </td><td>Uses JSON&#8217;s <code>\u</code> character escape</td></tr><tr><td><code>time</code> </td><td>string </td><td>string </td><td>Time of day in format <code>HH-MM-SS[.fffffffff]</code></td></tr><tr><td><code>timestamp</code></td><td>integer, string </td><td>string </td><td>A timestamp. Strings constant are allow to input timestamps as dates, see <a href="#usingdates">Working with dates</a> below for more information. Datestamps with format <code>YYYY-MM-DD HH:MM:SS.SSS</code> are returned.</td></tr><tr><td><code>timeuuid</code> </td><td>string </td><td>string </td><td>Type 1 UUID. See <a href="#constants">Constants</a> for the UUID format</td></tr><tr><td><code>tinyint</code> </td><td>integer, string </td><td>integer </td><td>String must be valid 8 bit integer</td></tr><tr><td><code>tuple</code> </td><td>list, string </td><td>list </td><td>Uses JSON&#8217;s native list representation</td></tr><tr><td><code>UDT</code> </td><td>map, string </td><td>map </td><td>Uses JSON&#8217;s native map representation with field names as keys</td></tr><tr><td><code>uuid</code> </td><td>string </td><td>string </td><td>See <a href="#constants">Constants</a> for the UUID format</td></tr><tr><td><code>varchar</code> </td><td>string </td><td>string </td><td>Uses JSON&#8217;s <code>\u</code> character escape</td></tr><tr><td><code>varint</code> </td><td>integer, string </td><td>integer </td><td>Variable length; may overflow 32 or 64 bit integers in client-side decoder</td></tr></table><h3 id="fromJson">The fromJson() Function</h3><p>The <code>fromJson()</code> function may be used similarly to <code>INSERT JSON</code>, but for a single column value. It may only be used in the <code>VALUES</code> clause of an <code>INSERT</code> statement or as one of the column values in an <code>UPDATE</code>, <code>DELETE</code>, or <code>SELECT</code> statement. For example, it cannot be used in the selection clause of a <code>SELECT</code> statement.</p><h3 id="toJson">The toJson() Function</h3><p>The <code>toJson()</code> function may be used similarly to <code>SELECT JSON</code>, but for a single column value. It may only be used in the selection clause of a <code>SELECT</code> statement.</p><h2 id="appendixA">Appendix A: CQL Keywords</h2><p>CQL distinguishes between <em>reserved</em> and <em>non-reserved</em> keywords. Reserved keywords cannot be used as identifier, they are truly reserved for the language (but one can enclose a reserved keyword by double-quotes to use it as an identifier). Non-reserved keywords however only have a specific meaning in certain context but can used as identifer otherwise. The only <em>raison d'��tre</em> of these non-reserved keywords is convenience: some keyword are non-reserved when it was always easy for the parser to decide whether they were used as keywords or not.</p><table><tr><th>Keyword </th><th>Reserved? </th></tr><tr><td><code>ADD</code> </td><td>yes </td></tr><tr><td><code>AGGREGATE</code> </td><td>no </td></tr><tr><td><code>ALL</code> </td><td>no </td></tr><tr><td><code>ALLOW</code> </td><td>yes </td></tr><tr><td><code>ALTER</code> </td><td>yes </td></tr><tr><td><code>AND</code> </td><td>yes </td></tr><tr><td><code>APPLY</code> </td><td>yes </td></tr><tr><td><code>AS</code> </td><td>no </td></tr><tr><td><code>ASC</code> </td><td>yes </td></tr><tr><td><code>ASCII</code> </td><td>no </td></tr><tr><td><code>AUTHORIZE</code> </td><td>yes </td></tr><tr><td><code>BATCH</code> </td><td>yes </td></tr><tr><td><code>BEGIN</code> </td><td>yes </td></tr><tr><td><code>BIGINT</code> </td><td>no </td></tr><tr><td><code>BLOB</code> </td><td>no </td></tr><tr><td><code>BOOLEAN</code> </td><td>no </td></tr><tr><td><code>BY</code> </td><td>yes </td></tr><tr><td><code>CALLED</code> </td><td>no </td></tr><tr><td><code>CLUSTERING</code> </td><td>no </td></tr><tr><td><code>COLUMNFAMILY</code> </td><td>yes </td></tr><tr><td><code>COMPACT</code> </td><td>no </td></tr><tr><td><code>CONTAINS</code> </td><td>no </td></tr><tr><td><code>COUNT</code> </td><td>no </td></tr><tr><td><code>COUNTER</code> </td><td>no </td></tr><tr><td><code>CREATE</code> </td><td>yes </td></tr><tr><td><code>CUSTOM</code> </td><td>no </td></tr><tr><td><code>DATE</code> </td><td>no </td></tr><tr><td><code>DECIMAL</code> </td><td>no </td></tr><tr><td><code>DELETE</code> </td><td>yes </td></tr><tr><td><code>DESC</code> </td><td>yes </td></tr><tr><td><code>DESCRIBE</code> </td><td>yes </td></tr><tr><td><code>DISTINCT</code> </td><td>no </td></tr><tr><td><code>DOUBLE</code> </td><td>no </td></tr><tr><td><code>DROP</code> </td><td>yes </td></tr><tr><td><code>ENTRIES</code> </td><td>yes </td></tr><tr><td><code>EXECUTE</code> </td><td>yes </td></tr><tr><td><code>EXISTS</code> </td><td>no </td></tr><tr><td><code>FILTERING</code> </td><td>no </td></tr><tr><td><code>FINALFUNC</code> </td><td>no </td></tr><tr><td><code>FLOAT</code> </td><td>no </td></tr><tr><td><code>FROM</code> </td><td>yes </td></tr><tr><td><code>FROZEN</code> </td><td>no </td></tr><tr><td><code>FULL</code> </td><td>yes </td></tr><tr><td><code>FUNCTION</code> </td><td>no </td></tr><tr><td><code>FUNCTIONS</code> </td><td>no </td></tr><tr><td><code>GRANT</code> </td><td>yes </td></tr><tr><td><code>IF</code> </td><td>yes </td></tr><tr><td><code>IN</code> </td><td>yes </td></tr><tr><td><code>INDEX</code> </td><td>yes </td></tr><tr><td><code>INET</code> </td><td>no </td></tr><tr><td><code>INFINITY</code> </td><td>yes </td></tr><tr><td><code>INITCOND</code> </td><td>no </td></tr><tr><td><code>INPUT</code> </td><td>no </td></tr><tr><td><code>INSERT</code> </td><td>yes </td></tr><tr><td><code>INT</code> </td><td>no </td></tr><tr><td><code>INTO</code> </td><td>yes </td></tr><tr><td><code>JSON</code> </td><td>no </td></tr><tr><td><code>KEY</code> </td><td>no </td></tr><tr><td><code>KEYS</code> </td><td>no </td></tr><tr><td><code>KEYSPACE</code> </td><td>yes </td></tr><tr><td><code>KEYSPACES</code> </td><td>no </td></tr><tr><td><code>LANGUAGE</code> </td><td>no </td></tr><tr><td><code>LIMIT</code> </td><td>yes </td></tr><tr><td><code>LIST</code> </td><td>no </td></tr><tr><td><code>LOGIN</code> </td><td>no </td></tr><tr><td><code>MAP</code> </td><td>no </td></tr><tr><td><code>MODIFY</code> </td><td>yes </td></tr><tr><td><code>NAN</code> </td><td>yes </td></tr><tr><td><code>NOLOGIN</code> </td><td>no </td></tr><tr><td><code>NORECURSIVE</code> </td><td>yes </td></tr><tr><td><code>NOSUPERUSER</code> </td><td>no </td></tr><tr><td><code>NOT</code> </td><td>yes </td></tr><tr><td><code>NULL</code> </td><td>yes </td></tr><tr><td><code>OF</code> </td><td>yes </td></tr><tr><td><code>ON</code> </td><td>yes </td></tr><tr><td><code>OPTIONS</code> </td><td>no </td></tr><tr><td><code>OR</code> </td><td>yes </td></tr><tr><td><code>ORDER</code> </td><td>yes </td></tr><tr><td><code>PASSWORD</code> </td><td>no </td></tr><tr><td><code>PERMISSION</code> </td><td>no </td></tr><tr><td><code>PERMISSIONS</code> </td><td>no </td></tr><tr><td><code>PRIMARY</code> </td><td>yes </td></tr><tr><td><code>RENAME</code> </td><td>yes </td></tr><tr><td><code>REPLACE</code> </td><td>yes </td></tr><tr><td><code>RETURNS</code> </td><td>no </td></tr><tr><td><code>REVOKE</code> </td><td>yes </td></tr><tr><td><code>ROLE</code> </td><td>no </td></tr><tr><td><code>ROLES</code> </td><td>no </td></tr><tr><td><code>SCHEMA</code> </td><td>yes </td></tr><tr><td><code>SELECT</code> </td><td>yes </td></tr><tr><td><code>SET</code> </td><td>yes </td></tr><tr><td><code>SFUNC</code> </td><td>no </td></tr><tr><td><code>SMALLINT</code> </td><td>no </td></tr><tr><td><code>STATIC</code> </td><td>no </td></tr><tr><td><code>STORAGE</code> </td><td>no </td></tr><tr><td><code>STYPE</code> </td><td>no </td></tr><tr><td><code>SUPERUSER</code> </td><td>no </td></tr><tr><td><code>TABLE</code> </td><td>yes </td></tr><tr><td><code>TEXT</code> </td><td>no </td></tr><tr><td><code>TIME</code> </td><td>no </td></tr><tr><td><code>TIMESTAMP</code> </td><td>no </td></tr><tr><td><code>TIMEUUID</code> </td><td>no </td></tr><tr><td><code>TINYINT</code> </td><td>no </td></tr><tr><td><code>TO</code> </td><td>yes </td></tr><tr><td><code>TOKEN</code> </td><td>yes </td></tr><tr><td><code>TRIGGER</code> </td><td>no </td></tr><tr><td><code>TRUNCATE</code> </td><td>yes </td></tr><tr><td><code>TTL</code> </td><td>no </td></tr><tr><td><code>TUPLE</code> </td><td>no </td></tr><tr><td><code>TYPE</code> </td><td>no </td></tr><tr><td><code>UNLOGGED</code> </td><td>yes </td></tr><tr><td><code>UPDATE</code> </td><td>yes </td></tr><tr><td><code>USE</code> </td><td>yes </td></tr><tr><td><code>USER</code> </td><td>no </td></tr><tr><td><code>USERS</code> </td><td>no </td></tr><tr><td><code>USING</code> </td><td>yes </td></tr><tr><td><code>UUID</code> </td><td>no </td></tr><tr><td><code>VALUES</code> </td><td>no </td></tr><tr><td><code>VARCHAR</code> </td><td>no </td></tr><tr><td><code>VARINT</code> </td><td>no </td></tr><tr><td><code>WHERE</code> </td><td>yes </td></tr><tr><td><code>WITH</code> </td><td>yes </td></tr><tr><td><code>WRITETIME</code> </td><td>no </td></tr></table><h2 id="appendixB">Appendix B: CQL Reserved Types</h2><p>The following type names are not currently used by CQL, but are reserved for potential future use. User-defined types may not use reserved type names as their name.</p><table><tr><th>type </th></tr><tr><td><code>bitstring</code> </td></tr><tr><td><code>byte</code> </td></tr><tr><td><code>complex</code> </td></tr><tr><td><code>date</code> </td></tr><tr><td><code>enum</code> </td></tr><tr><td><code>interval</code> </td></tr><tr><td><code>macaddr</code> </td></tr><tr><td><code>smallint</code> </td></tr></table><h2 id="changes">Changes</h2><p>The following describes the changes in each version of CQL.</p><h3 id="a3.3.1">3.3.1</h3><ul><li>The syntax <code>TRUNCATE TABLE X</code> is now accepted as an alias for <code>TRUNCATE X</code></li></ul><h3 id="a3.3.0">3.3.0</h3><ul><li>Adds new <a href="#aggregates">aggregates</a></li><li>User-defined functions are now supported through <a href="#createFunctionStmt"><code>CREATE FUNCTION</code></a> and <a href="#dropFunctionStmt"><code>DROP FUNCTION</code></a>.</li><li>User-defined aggregates are now supported through <a href="#createAggregateStmt"><code>CREATE AGGREGATE</code></a> and <a href="#dropAggregateStmt"><code>DROP AGGREGATE</code></a>.</li><li>Allows double-dollar enclosed strings literals as an alternative to single-quote enclosed strings.</li><li>Introduces Roles to supercede user based authentication and access control</li><li><a href="#usingdates"><code>Date</code></a> and <a href="usingtime"><code>Time</code></a> data types have been added</li><li><a href="#json"><code>JSON</code></a> support has been added</li><li><code>Tinyint</code> and <code>Smallint</code> data types have been added</li><li>Adds new time conversion functions and deprecate <code>dateOf</code> and <code>unixTimestampOf</code>. See <a href="#timeFun"><code>Time conversion functions</code></a></li></ul><h3 id="a3.2.0">3.2.0</h3><ul><li>User-defined types are now supported through <a href="#createTypeStmt"><code>CREATE TYPE</code></a>, <a href="#alterTypeStmt"><code>ALTER TYPE</code></a>, and <a href="#dropTypeStmt"><code>DROP TYPE</code></a></li><li><a href="#createIndexStmt"><code>CREATE INDEX</code></a> now supports indexing collection columns, including indexing the keys of map collections through the <code>keys()</code> function</li><li>Indexes on collections may be queried using the new <code>CONTAINS</code> and <code>CONTAINS KEY</code> operators</li><li>Tuple types were added to hold fixed-length sets of typed positional fields (see the section on <a href="#types">types</a> )</li><li><a href="#dropIndexStmt"><code>DROP INDEX</code></a> now supports optionally specifying a keyspace</li></ul><h3 id="a3.1.7">3.1.7</h3><ul><li><code>SELECT</code> statements now support selecting multiple rows in a single partition using an <code>IN</code> clause on combinations of clustering columns. See <a href="#selectWhere">SELECT WHERE</a> clauses.</li><li><code>IF NOT EXISTS</code> and <code>IF EXISTS</code> syntax is now supported by <code>CREATE USER</code> and <code>DROP USER</code> statmenets, respectively.</li></ul><h3 id="a3.1.6">3.1.6</h3><ul><li>A new <a href="#uuidFun"><code>uuid</code> method</a> has been added.</li><li>Support for <code>DELETE ... IF EXISTS</code> syntax.</li></ul><h3 id="a3.1.5">3.1.5</h3><ul><li>It is now possible to group clustering columns in a relatiion, see <a href="#selectWhere">SELECT WHERE</a> clauses.</li><li>Added support for <code>STATIC</code> columns, see <a href="#createTableStatic">static in CREATE TABLE</a>.</li></ul><h3 id="a3.1.4">3.1.4</h3><ul><li><code>CREATE INDEX</code> now allows specifying options when creating CUSTOM indexes (see <a href="#createIndexStmt">CREATE INDEX reference</a> ).</li></ul><h3 id="a3.1.3">3.1.3</h3><ul><li>Millisecond precision formats have been added to the timestamp parser (see <a href="#usingtimestamps">working with dates</a> ).</li></ul><h3 id="a3.1.2">3.1.2</h3><ul><li><code>NaN</code> and <code>Infinity</code> has been added as valid float contants. They are now reserved keywords. In the unlikely case you we using them as a column identifier (or keyspace/table one), you will noew need to double quote them (see <a href="#identifiers">quote identifiers</a> ).</li></ul><h3 id="a3.1.1">3.1.1</h3><ul><li><code>SELECT</code> statement now allows listing the partition keys (using the <code>DISTINCT</code> modifier). See <a href="https://issues.apache.org/jira/browse/CASSANDRA-4536">CASSANDRA-4536</a>.</li><li>The syntax <code>c IN ?</code> is now supported in <code>WHERE</code> clauses. In that case, the value expected for the bind variable will be a list of whatever type <code>c</code> is.</li><li>It is now possible to use named bind variables (using <code>:name</code> instead of <code>?</code>).</li></ul><h3 id="a3.1.0">3.1.0</h3><ul><li><a href="#alterTableStmt">ALTER TABLE</a> <code>DROP</code> option has been reenabled for CQL3 tables and has new semantics now: the space formerly used by dropped columns will now be eventually reclaimed (post-compaction). You should not readd previously dropped columns unless you use timestamps with microsecond precision (see <a href="https://issues.apache.org/jira/browse/CASSANDRA-3919">CASSANDRA-3919</a> for more details).</li><li><code>SELECT</code> statement now supports aliases in select clause. Aliases in WHERE and ORDER BY clauses are not supported. See the <a href="#selectStmt">section on select</a> for details.</li><li><code>CREATE</code> statements for <code>KEYSPACE</code>, <code>TABLE</code> and <code>INDEX</code> now supports an <code>IF NOT EXISTS</code> condition. Similarly, <code>DROP</code> statements support a <code>IF EXISTS</code> condition.</li><li><code>INSERT</code> statements optionally supports a <code>IF NOT EXISTS</code> condition and <code>UPDATE</code> supports <code>IF</code> conditions.</li></ul><h3 id="a3.0.5">3.0.5</h3><ul><li><code>SELECT</code>, <code>UPDATE</code>, and <code>DELETE</code> statements now allow empty <code>IN</code> relations (see <a href="https://issues.apache.org/jira/browse/CASSANDRA-5626">CASSANDRA-5626</a>).</li></ul><h3 id="a3.0.4">3.0.4</h3><ul><li>Updated the syntax for custom <a href="#createIndexStmt">secondary indexes</a>.</li><li>Non-equal condition on the partition key are now never supported, even for ordering partitioner as this was not correct (the order was <strong>not</strong> the one of the type of the partition key). Instead, the <code>token</code> method should always be used for range queries on the partition key (see <a href="#selectWhere">WHERE clauses</a> ).</li></ul><h3 id="a3.0.3">3.0.3</h3><ul><li>Support for custom <a href="#createIndexStmt">secondary indexes</a> has been added.</li></ul><h3 id="a3.0.2">3.0.2</h3><ul><li>Type validation for the <a href="#constants">constants</a> has been fixed. For instance, the implementation used to allow <code>'2'</code> as a valid value for an <code>int</code> column (interpreting it has the equivalent of <code>2</code>), or <code>42</code> as a valid <code>blob</code> value (in which case <code>42</code> was interpreted as an hexadecimal representation of the blob). This is no longer the case, type validation of constants is now more strict. See the <a href="#types">data types</a> section for details on which constant is allowed for which type.</li><li>The type validation fixed of the previous point has lead to the introduction of <a href="#constants">blobs constants</a> to allow inputing blobs. Do note that while inputing blobs as strings constant is still supported by this version (to allow smoother transition to blob constant), it is now deprecated (in particular the <a href="#types">data types</a> section does not list strings constants as valid blobs) and will be removed by a future version. If you were using strings as blobs, you should thus update your client code ASAP to switch blob constants.</li><li>A number of functions to convert native types to blobs have also been introduced. Furthermore the token function is now also allowed in select clauses. See the <a href="#functions">section on functions</a> for details.</li></ul><h3 id="a3.0.1">3.0.1</h3><ul><li><a href="#usingtimestamps">Date strings</a> (and timestamps) are no longer accepted as valid <code>timeuuid</code> values. Doing so was a bug in the sense that date string are not valid <code>timeuuid</code>, and it was thus resulting in <a href="https://issues.apache.org/jira/browse/CASSANDRA-4936">confusing behaviors</a>. However, the following new methods have been added to help working with <code>timeuuid</code>: <code>now</code>, <code>minTimeuuid</code>, <code>maxTimeuuid</code> , <code>dateOf</code> and <code>unixTimestampOf</code>. See the <a href="#timeuuidFun">section dedicated to these methods</a> for more detail.</li><li>&#8220;Float constants&#8221;#constants now support the exponent notation. In other words, <code>4.2E10</code> is now a valid floating point value.</li></ul><h2 id="Versioning">Versioning</h2><p>Versioning of the CQL language adheres to the <a href="http://semver.org">Semantic Versioning</a> guidelines. Versions take the form X.Y.Z where X, Y, and Z are integer values representing major, minor, and patch level respectively. There is no correlation between Cassandra release versions and the CQL language version.</p><table><tr><th>version</th><th>description</th></tr><tr><td>Major </td><td>The major version <em>must</em> be bumped when backward incompatible changes are introduced. This should rarely occur.</td></tr><tr><td>Minor </td><td>Minor version increments occur when new, but backward compatible, functionality is introduced.</td></tr><tr><td>Patch </td><td>The patch version is incremented when bugs are fixed.</td></tr></table></body></html>

Event Timeline

Eevans changed the title of this paste from untitled to Masterwork From Distant Lands.
Eevans updated the paste's language from autodetect to autodetect.
Eevans updated the paste's language from autodetect to diff.Mar 12 2018, 9:34 PM