You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2014/03/19 17:39:19 UTC

[1/6] git commit: Add uuid() function patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-6473

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 91e4d2288 -> 32c15c2fb
  refs/heads/cassandra-2.1 0ccee7f58 -> a45fea8fc
  refs/heads/trunk 51e41a7fb -> 96b55cecc


Add uuid() function
patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-6473


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/32c15c2f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/32c15c2f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/32c15c2f

Branch: refs/heads/cassandra-2.0
Commit: 32c15c2fb0d31a8f061a8fb812c2d4851d52ef2f
Parents: 91e4d22
Author: Carl Yeksigian <ca...@yeksigian.com>
Authored: Sat Mar 15 20:11:46 2014 -0400
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Wed Mar 19 11:38:26 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 doc/cql3/CQL.textile                            |  4 ++
 .../cassandra/cql3/functions/Functions.java     |  1 +
 .../cassandra/cql3/functions/UuidFcts.java      | 42 ++++++++++++++++++++
 4 files changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2bb3605..41ec1d7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.7
+ * Add uuid() function (CASSANDRA-6473)
  * Omit tombstones from schema digests (CASSANDRA-6862)
  * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884)
  * Lower chances for losing new SSTables during nodetool refresh and

http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/doc/cql3/CQL.textile
----------------------------------------------------------------------
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index 566d13c..b323f20 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -1007,6 +1007,10 @@ CREATE TABLE users (
 
 then the @token@ function will take a single argument of type @text@ (in that case, the partition key is @userid@ (there is no clustering columns so the partition key is the same than the primary key)), and the return type will be @bigint@.
 
+h3(#uuidFun). Uuid
+
+The @uuid@ function takes no parameters and generates a random type 4 uuid suitable for use in INSERT or SET statements.
+
 h3(#timeuuidFun). Timeuuid functions
 
 h4. @now@

http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/src/java/org/apache/cassandra/cql3/functions/Functions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/functions/Functions.java b/src/java/org/apache/cassandra/cql3/functions/Functions.java
index 97a0e91..5f4201d 100644
--- a/src/java/org/apache/cassandra/cql3/functions/Functions.java
+++ b/src/java/org/apache/cassandra/cql3/functions/Functions.java
@@ -44,6 +44,7 @@ public abstract class Functions
         declared.put("maxtimeuuid", AbstractFunction.factory(TimeuuidFcts.maxTimeuuidFct));
         declared.put("dateof", AbstractFunction.factory(TimeuuidFcts.dateOfFct));
         declared.put("unixtimestampof", AbstractFunction.factory(TimeuuidFcts.unixTimestampOfFct));
+        declared.put("uuid", AbstractFunction.factory(UuidFcts.uuidFct));
 
         for (CQL3Type type : CQL3Type.Native.values())
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java b/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java
new file mode 100644
index 0000000..718bcbc
--- /dev/null
+++ b/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.cql3.functions;
+
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.cassandra.db.marshal.UUIDType;
+import org.apache.cassandra.serializers.UUIDSerializer;
+
+public abstract class UuidFcts
+{
+    public static final Function uuidFct = new AbstractFunction("uuid", UUIDType.instance)
+    {
+        public ByteBuffer execute(List<ByteBuffer> parameters)
+        {
+            return UUIDSerializer.instance.serialize(UUID.randomUUID());
+        }
+
+        @Override
+        public boolean isPure()
+        {
+            return false;
+        }
+    };
+}


[6/6] git commit: Merge branch 'cassandra-2.1' into trunk

Posted by jb...@apache.org.
Merge branch 'cassandra-2.1' into trunk


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/96b55cec
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/96b55cec
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/96b55cec

Branch: refs/heads/trunk
Commit: 96b55cecc37d69c0a3bc292ed9c0e12452559fda
Parents: 51e41a7 a45fea8
Author: Jonathan Ellis <jb...@apache.org>
Authored: Wed Mar 19 11:39:13 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Wed Mar 19 11:39:13 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 doc/cql3/CQL.textile                            |  4 ++
 .../cassandra/cql3/functions/Functions.java     |  1 +
 .../cassandra/cql3/functions/UuidFcts.java      | 42 ++++++++++++++++++++
 4 files changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/96b55cec/CHANGES.txt
----------------------------------------------------------------------


[4/6] git commit: merge from 2.0

Posted by jb...@apache.org.
merge from 2.0


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a45fea8f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a45fea8f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a45fea8f

Branch: refs/heads/trunk
Commit: a45fea8fc67f770556a915b80ef6bea0c62ae3ee
Parents: 0ccee7f 32c15c2
Author: Jonathan Ellis <jb...@apache.org>
Authored: Wed Mar 19 11:38:54 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Wed Mar 19 11:38:54 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 doc/cql3/CQL.textile                            |  4 ++
 .../cassandra/cql3/functions/Functions.java     |  1 +
 .../cassandra/cql3/functions/UuidFcts.java      | 42 ++++++++++++++++++++
 4 files changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a45fea8f/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 159d242,41ec1d7..75f4cee
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,29 -1,5 +1,30 @@@
 -2.0.7
 +2.1.0-beta2
 + * Eliminate possibility of CL segment appearing twice in active list 
 +   (CASSANDRA-6557)
 + * Apply DONTNEED fadvise to commitlog segments (CASSANDRA-6759)
 + * Switch CRC component to Adler and include it for compressed sstables 
 +   (CASSANDRA-4165)
 + * Allow cassandra-stress to set compaction strategy options (CASSANDRA-6451)
 + * Add broadcast_rpc_address option to cassandra.yaml (CASSANDRA-5899)
 + * Auto reload GossipingPropertyFileSnitch config (CASSANDRA-5897)
 + * Fix overflow of memtable_total_space_in_mb (CASSANDRA-6573)
 + * Fix ABTC NPE and apply update function correctly (CASSANDRA-6692)
 + * Allow nodetool to use a file or prompt for password (CASSANDRA-6660)
 + * Fix AIOOBE when concurrently accessing ABSC (CASSANDRA-6742)
 + * Fix assertion error in ALTER TYPE RENAME (CASSANDRA-6705)
 + * Scrub should not always clear out repaired status (CASSANDRA-5351)
 + * Improve handling of range tombstone for wide partitions (CASSANDRA-6446)
 + * Fix ClassCastException for compact table with composites (CASSANDRA-6738)
 + * Fix potentially repairing with wrong nodes (CASSANDRA-6808)
 + * Change caching option syntax (CASSANDRA-6745)
 + * Fix stress to do proper counter reads (CASSANDRA-6835)
 + * Fix help message for stress counter_write (CASSANDRA-6824)
 + * Fix stress smart Thrift client to pick servers correctly (CASSANDRA-6848)
 + * Add logging levels (minimal, normal or verbose) to stress tool (CASSANDRA-6849)
 + * Fix race condition in Batch CLE (CASSANDRA-6860)
 + * Improve cleanup/scrub/upgradesstables failure handling (CASSANDRA-6774)
 +Merged from 2.0:
+  * Add uuid() function (CASSANDRA-6473)
   * Omit tombstones from schema digests (CASSANDRA-6862)
   * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884)
   * Lower chances for losing new SSTables during nodetool refresh and

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a45fea8f/doc/cql3/CQL.textile
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a45fea8f/src/java/org/apache/cassandra/cql3/functions/Functions.java
----------------------------------------------------------------------


[2/6] git commit: Add uuid() function patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-6473

Posted by jb...@apache.org.
Add uuid() function
patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-6473


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/32c15c2f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/32c15c2f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/32c15c2f

Branch: refs/heads/cassandra-2.1
Commit: 32c15c2fb0d31a8f061a8fb812c2d4851d52ef2f
Parents: 91e4d22
Author: Carl Yeksigian <ca...@yeksigian.com>
Authored: Sat Mar 15 20:11:46 2014 -0400
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Wed Mar 19 11:38:26 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 doc/cql3/CQL.textile                            |  4 ++
 .../cassandra/cql3/functions/Functions.java     |  1 +
 .../cassandra/cql3/functions/UuidFcts.java      | 42 ++++++++++++++++++++
 4 files changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2bb3605..41ec1d7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.7
+ * Add uuid() function (CASSANDRA-6473)
  * Omit tombstones from schema digests (CASSANDRA-6862)
  * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884)
  * Lower chances for losing new SSTables during nodetool refresh and

http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/doc/cql3/CQL.textile
----------------------------------------------------------------------
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index 566d13c..b323f20 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -1007,6 +1007,10 @@ CREATE TABLE users (
 
 then the @token@ function will take a single argument of type @text@ (in that case, the partition key is @userid@ (there is no clustering columns so the partition key is the same than the primary key)), and the return type will be @bigint@.
 
+h3(#uuidFun). Uuid
+
+The @uuid@ function takes no parameters and generates a random type 4 uuid suitable for use in INSERT or SET statements.
+
 h3(#timeuuidFun). Timeuuid functions
 
 h4. @now@

http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/src/java/org/apache/cassandra/cql3/functions/Functions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/functions/Functions.java b/src/java/org/apache/cassandra/cql3/functions/Functions.java
index 97a0e91..5f4201d 100644
--- a/src/java/org/apache/cassandra/cql3/functions/Functions.java
+++ b/src/java/org/apache/cassandra/cql3/functions/Functions.java
@@ -44,6 +44,7 @@ public abstract class Functions
         declared.put("maxtimeuuid", AbstractFunction.factory(TimeuuidFcts.maxTimeuuidFct));
         declared.put("dateof", AbstractFunction.factory(TimeuuidFcts.dateOfFct));
         declared.put("unixtimestampof", AbstractFunction.factory(TimeuuidFcts.unixTimestampOfFct));
+        declared.put("uuid", AbstractFunction.factory(UuidFcts.uuidFct));
 
         for (CQL3Type type : CQL3Type.Native.values())
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java b/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java
new file mode 100644
index 0000000..718bcbc
--- /dev/null
+++ b/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.cql3.functions;
+
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.cassandra.db.marshal.UUIDType;
+import org.apache.cassandra.serializers.UUIDSerializer;
+
+public abstract class UuidFcts
+{
+    public static final Function uuidFct = new AbstractFunction("uuid", UUIDType.instance)
+    {
+        public ByteBuffer execute(List<ByteBuffer> parameters)
+        {
+            return UUIDSerializer.instance.serialize(UUID.randomUUID());
+        }
+
+        @Override
+        public boolean isPure()
+        {
+            return false;
+        }
+    };
+}


[5/6] git commit: merge from 2.0

Posted by jb...@apache.org.
merge from 2.0


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a45fea8f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a45fea8f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a45fea8f

Branch: refs/heads/cassandra-2.1
Commit: a45fea8fc67f770556a915b80ef6bea0c62ae3ee
Parents: 0ccee7f 32c15c2
Author: Jonathan Ellis <jb...@apache.org>
Authored: Wed Mar 19 11:38:54 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Wed Mar 19 11:38:54 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 doc/cql3/CQL.textile                            |  4 ++
 .../cassandra/cql3/functions/Functions.java     |  1 +
 .../cassandra/cql3/functions/UuidFcts.java      | 42 ++++++++++++++++++++
 4 files changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a45fea8f/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 159d242,41ec1d7..75f4cee
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,29 -1,5 +1,30 @@@
 -2.0.7
 +2.1.0-beta2
 + * Eliminate possibility of CL segment appearing twice in active list 
 +   (CASSANDRA-6557)
 + * Apply DONTNEED fadvise to commitlog segments (CASSANDRA-6759)
 + * Switch CRC component to Adler and include it for compressed sstables 
 +   (CASSANDRA-4165)
 + * Allow cassandra-stress to set compaction strategy options (CASSANDRA-6451)
 + * Add broadcast_rpc_address option to cassandra.yaml (CASSANDRA-5899)
 + * Auto reload GossipingPropertyFileSnitch config (CASSANDRA-5897)
 + * Fix overflow of memtable_total_space_in_mb (CASSANDRA-6573)
 + * Fix ABTC NPE and apply update function correctly (CASSANDRA-6692)
 + * Allow nodetool to use a file or prompt for password (CASSANDRA-6660)
 + * Fix AIOOBE when concurrently accessing ABSC (CASSANDRA-6742)
 + * Fix assertion error in ALTER TYPE RENAME (CASSANDRA-6705)
 + * Scrub should not always clear out repaired status (CASSANDRA-5351)
 + * Improve handling of range tombstone for wide partitions (CASSANDRA-6446)
 + * Fix ClassCastException for compact table with composites (CASSANDRA-6738)
 + * Fix potentially repairing with wrong nodes (CASSANDRA-6808)
 + * Change caching option syntax (CASSANDRA-6745)
 + * Fix stress to do proper counter reads (CASSANDRA-6835)
 + * Fix help message for stress counter_write (CASSANDRA-6824)
 + * Fix stress smart Thrift client to pick servers correctly (CASSANDRA-6848)
 + * Add logging levels (minimal, normal or verbose) to stress tool (CASSANDRA-6849)
 + * Fix race condition in Batch CLE (CASSANDRA-6860)
 + * Improve cleanup/scrub/upgradesstables failure handling (CASSANDRA-6774)
 +Merged from 2.0:
+  * Add uuid() function (CASSANDRA-6473)
   * Omit tombstones from schema digests (CASSANDRA-6862)
   * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884)
   * Lower chances for losing new SSTables during nodetool refresh and

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a45fea8f/doc/cql3/CQL.textile
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a45fea8f/src/java/org/apache/cassandra/cql3/functions/Functions.java
----------------------------------------------------------------------


[3/6] git commit: Add uuid() function patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-6473

Posted by jb...@apache.org.
Add uuid() function
patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-6473


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/32c15c2f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/32c15c2f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/32c15c2f

Branch: refs/heads/trunk
Commit: 32c15c2fb0d31a8f061a8fb812c2d4851d52ef2f
Parents: 91e4d22
Author: Carl Yeksigian <ca...@yeksigian.com>
Authored: Sat Mar 15 20:11:46 2014 -0400
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Wed Mar 19 11:38:26 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 doc/cql3/CQL.textile                            |  4 ++
 .../cassandra/cql3/functions/Functions.java     |  1 +
 .../cassandra/cql3/functions/UuidFcts.java      | 42 ++++++++++++++++++++
 4 files changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2bb3605..41ec1d7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.7
+ * Add uuid() function (CASSANDRA-6473)
  * Omit tombstones from schema digests (CASSANDRA-6862)
  * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884)
  * Lower chances for losing new SSTables during nodetool refresh and

http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/doc/cql3/CQL.textile
----------------------------------------------------------------------
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index 566d13c..b323f20 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -1007,6 +1007,10 @@ CREATE TABLE users (
 
 then the @token@ function will take a single argument of type @text@ (in that case, the partition key is @userid@ (there is no clustering columns so the partition key is the same than the primary key)), and the return type will be @bigint@.
 
+h3(#uuidFun). Uuid
+
+The @uuid@ function takes no parameters and generates a random type 4 uuid suitable for use in INSERT or SET statements.
+
 h3(#timeuuidFun). Timeuuid functions
 
 h4. @now@

http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/src/java/org/apache/cassandra/cql3/functions/Functions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/functions/Functions.java b/src/java/org/apache/cassandra/cql3/functions/Functions.java
index 97a0e91..5f4201d 100644
--- a/src/java/org/apache/cassandra/cql3/functions/Functions.java
+++ b/src/java/org/apache/cassandra/cql3/functions/Functions.java
@@ -44,6 +44,7 @@ public abstract class Functions
         declared.put("maxtimeuuid", AbstractFunction.factory(TimeuuidFcts.maxTimeuuidFct));
         declared.put("dateof", AbstractFunction.factory(TimeuuidFcts.dateOfFct));
         declared.put("unixtimestampof", AbstractFunction.factory(TimeuuidFcts.unixTimestampOfFct));
+        declared.put("uuid", AbstractFunction.factory(UuidFcts.uuidFct));
 
         for (CQL3Type type : CQL3Type.Native.values())
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/32c15c2f/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java b/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java
new file mode 100644
index 0000000..718bcbc
--- /dev/null
+++ b/src/java/org/apache/cassandra/cql3/functions/UuidFcts.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.cql3.functions;
+
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.cassandra.db.marshal.UUIDType;
+import org.apache.cassandra.serializers.UUIDSerializer;
+
+public abstract class UuidFcts
+{
+    public static final Function uuidFct = new AbstractFunction("uuid", UUIDType.instance)
+    {
+        public ByteBuffer execute(List<ByteBuffer> parameters)
+        {
+            return UUIDSerializer.instance.serialize(UUID.randomUUID());
+        }
+
+        @Override
+        public boolean isPure()
+        {
+            return false;
+        }
+    };
+}