Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 43496384d -> 926f639a5
Bump CQL version to 3.1.7, update CQL docs Follow up for CASSANDRA-6875 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/926f639a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/926f639a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/926f639a Branch: refs/heads/cassandra-2.0 Commit: 926f639a53fdd260bc789a3cd69a49186b7e7c76 Parents: 4349638 Author: Tyler Hobbs <ty...@datastax.com> Authored: Fri May 23 11:20:10 2014 -0500 Committer: Tyler Hobbs <ty...@datastax.com> Committed: Fri May 23 11:20:10 2014 -0500 ---------------------------------------------------------------------- doc/cql3/CQL.textile | 20 +++++++++++++++----- .../apache/cassandra/cql3/QueryProcessor.java | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/926f639a/doc/cql3/CQL.textile ---------------------------------------------------------------------- diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile index 66a4566..3c64bc6 100644 --- a/doc/cql3/CQL.textile +++ b/doc/cql3/CQL.textile @@ -1,6 +1,6 @@ <link rel="StyleSheet" href="CQL.css" type="text/css" media="screen"> -h1. Cassandra Query Language (CQL) v3.1.5 +h1. Cassandra Query Language (CQL) v3.1.7 <span id="tableOfContents"> @@ -665,13 +665,15 @@ bc(syntax).. <where-clause> ::= <relation> ( AND <relation> )* <relation> ::= <identifier> <op> <term> - | '(' <identifier> (',' <identifier>)* ')' <op> '(' <term> (',' <term>)* ')' + | '(' <identifier> (',' <identifier>)* ')' <op> <term-tuple> | <identifier> IN '(' ( <term> ( ',' <term>)* )? ')' + | '(' <identifier> (',' <identifier>)* ')' IN '(' ( <term-tuple> ( ',' <term-tuple>)* )? ')' | TOKEN '(' <identifier> ( ',' <identifer>)* ')' <op> <term> <op> ::= '=' | '<' | '>' | '<=' | '>=' <order-by> ::= <ordering> ( ',' <odering> )* <ordering> ::= <identifer> ( ASC | DESC )? +<term-tuple> ::= '(' <term> (',' <term>)* ')' p. __Sample:__ @@ -738,7 +740,7 @@ SELECT * FROM posts WHERE token(userid) > token('tom') AND token(userid) < token Moreover, the @IN@ relation is only allowed on the last column of the partition key and on the last column of the full primary key. -It is also possible to "group" @CLUSTERING COLUMNS@ together in a relation, for instance: +It is also possible to "group" @CLUSTERING COLUMNS@ together in a relation using the tuple notation. For instance: bc(sample). SELECT * FROM posts WHERE userid='john doe' AND (blog_title, posted_at) > ('John''s Blog', '2012-01-01') @@ -748,6 +750,11 @@ will request all rows that sorts after the one having "John's Blog" as @blog_til bc(sample). SELECT * FROM posts WHERE userid='john doe' AND blog_title > 'John''s Blog' AND posted_at > '2012-01-01' +The tuple notation may also be used for @IN@ clauses on @CLUSTERING COLUMNS@: + +bc(sample). +SELECT * FROM posts WHERE userid='john doe' AND (blog_title, posted_at) IN (('John''s Blog', '2012-01-01), ('Extreme Chess', '2014-06-01')) + h4(#selectOrderBy). @<order-by>@ The @ORDER BY@ option allows to select the order of the returned results. It takes as argument a list of column names along with the order for the column (@ASC@ for ascendant and @DESC@ for descendant, omitting the order being equivalent to @ASC@). Currently the possible orderings are limited (which depends on the table "@CLUSTERING ORDER@":#createTableOptions): @@ -1162,15 +1169,18 @@ h2(#changes). Changes The following describes the addition/changes brought for each version of CQL. +h3. 3.1.7 + +* @SELECT@ statements now support selecting multiple rows in a single partition using an @IN@ clause on combinations of clustering columns. See "SELECT WHERE":#selectWhere clauses. + h3. 3.1.6 * A new "@uuid@ method":#uuidFun has been added. * Support for @DELETE ... IF EXISTS@ syntax. - h3. 3.1.5 -* It is now possible to group clustering columns in a relatiion, see "SELECT Where clauses":#selectWhere. +* It is now possible to group clustering columns in a relatiion, see "SELECT WHERE":#selectWhere clauses. * Added support for @STATIC@ columns, see "static in CREATE TABLE":#createTableStatic. h3. 3.1.4 http://git-wip-us.apache.org/repos/asf/cassandra/blob/926f639a/src/java/org/apache/cassandra/cql3/QueryProcessor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java b/src/java/org/apache/cassandra/cql3/QueryProcessor.java index 30d1bd7..3d9c5a8 100644 --- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java +++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java @@ -43,7 +43,7 @@ import org.apache.cassandra.utils.SemanticVersion; public class QueryProcessor implements QueryHandler { - public static final SemanticVersion CQL_VERSION = new SemanticVersion("3.1.6"); + public static final SemanticVersion CQL_VERSION = new SemanticVersion("3.1.7"); public static final QueryProcessor instance = new QueryProcessor();