Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E3F9A18580 for ; Mon, 6 Jul 2015 13:59:03 +0000 (UTC) Received: (qmail 35712 invoked by uid 500); 6 Jul 2015 13:59:03 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 35674 invoked by uid 500); 6 Jul 2015 13:59:03 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 35663 invoked by uid 99); 6 Jul 2015 13:59:03 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2015 13:59:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3D007E0286; Mon, 6 Jul 2015 13:59:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: snazy@apache.org To: commits@cassandra.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: cassandra git commit: Fix broken CQL.textile and "ant generate-cql-html" Date: Mon, 6 Jul 2015 13:59:03 +0000 (UTC) Repository: cassandra Updated Branches: refs/heads/cassandra-2.2 77a666c69 -> fe0709236 Fix broken CQL.textile and "ant generate-cql-html" patch by Christopher Batey; reviewed by Robert Stupp for CASSANDRA-9725 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/fe070923 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/fe070923 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/fe070923 Branch: refs/heads/cassandra-2.2 Commit: fe07092361b1119da9b59302484664f1e8bcf324 Parents: 77a666c Author: Christoher Batey Authored: Mon Jul 6 20:42:49 2015 +0700 Committer: Robert Stupp Committed: Mon Jul 6 20:58:09 2015 +0700 ---------------------------------------------------------------------- doc/cql3/CQL.textile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/fe070923/doc/cql3/CQL.textile ---------------------------------------------------------------------- diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile index 7fa333d..ca09627 100644 --- a/doc/cql3/CQL.textile +++ b/doc/cql3/CQL.textile @@ -1806,15 +1806,18 @@ The @now@ function takes no arguments and generates a new unique timeuuid (at th bc(sample). SELECT * FROM myTable WHERE t = now() + will never return any result by design, since the value returned by @now()@ is guaranteed to be unique. h4. @minTimeuuid@ and @maxTimeuuid@ The @minTimeuuid@ (resp. @maxTimeuuid@) function takes a @timestamp@ value @t@ (which can be "either a timestamp or a date string":#usingtimestamps ) and return a _fake_ @timeuuid@ corresponding to the _smallest_ (resp. _biggest_) possible @timeuuid@ having for timestamp @t@. So for instance: - + + bc(sample). SELECT * FROM myTable WHERE t > maxTimeuuid('2013-01-01 00:05+0000') AND t < minTimeuuid('2013-02-02 10:00+0000') - + + will select all rows where the @timeuuid@ column @t@ is strictly older than '2013-01-01 00:05+0000' but strictly younger than '2013-02-02 10:00+0000'. Please note that @t >= maxTimeuuid('2013-01-01 00:05+0000')@ would still _not_ select a @timeuuid@ generated exactly at '2013-01-01 00:05+0000' and is essentially equivalent to @t > maxTimeuuid('2013-01-01 00:05+0000')@. _Warning_: We called the values generated by @minTimeuuid@ and @maxTimeuuid@ _fake_ UUID because they do no respect the Time-Based UUID generation process specified by the "RFC 4122":http://www.ietf.org/rfc/rfc4122.txt. In particular, the value returned by these 2 methods will not be unique. This means you should only use those methods for querying (as in the example above). Inserting the result of those methods is almost certainly _a bad idea_. @@ -1846,30 +1849,36 @@ h3(#countFct). Count The @count@ function can be used to count the rows returned by a query. Example: -bc(sample). +bc(sample). SELECT COUNT(*) FROM plays; SELECT COUNT(1) FROM plays; It also can be used to count the non null value of a given column. Example: -bc(sample). +bc(sample). SELECT COUNT(scores) FROM plays; h3(#maxMinFcts). Max and Min The @max@ and @min@ functions can be used to compute the maximum and the minimum value returned by a query for a given column. -bc(sample). +bc(sample). SELECT MIN(players), MAX(players) FROM plays WHERE game = 'quake'; h3(#sumFct). Sum The @sum@ function can be used to sum up all the values returned by a query for a given column. -h3(#sumFct). Avg +bc(sample). +SELECT SUM(players) FROM plays; + +h3(#avgFct). Avg The @avg@ function can be used to compute the average of all the values returned by a query for a given column. +bc(sample). +SELECT AVG(players) FROM plays; + h2(#udfs). User-Defined Functions User-defined functions allow execution of user-provided code in Cassandra. By default, Cassandra supports defining functions in _Java_ and _JavaScript_. Support for other JSR 223 compliant scripting languages (such as Python, Ruby, and Scala) can be added by adding a JAR to the classpath.