cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject cassandra git commit: Fix broken CQL.textile and "ant generate-cql-html"
Date Mon, 06 Jul 2015 13:59:03 GMT
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 <christopher.batey@gmail.com>
Authored: Mon Jul 6 20:42:49 2015 +0700
Committer: Robert Stupp <snazy@snazy.de>
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.


Mime
View raw message