Anyway to solve those kind of issue? Like ignore if field is null or not null fields set 0 date while altering table?

Sounds like a bug, I could not find an existing ticket so can you raise a ticket at ? 

Please include the version you are using.

Aaron Morton
Cassandra Consultant
New Zealand


On 12/08/2013, at 1:42 PM, Saravanan <> wrote:

found the issue. It should not be null when using function on the field.

Anyway to solve those kind of issue? Like ignore if field is null or not null fields set 0 date while altering table?

cqlsh:demodb> select dateof(search_date) from news_comments where search_date=a7790001-02e8-11e3-bc81-fb4a940b08ec and userid=21 allow filtering;

 2013-08-12 02:46:41+0200


From: Saravanan <>
To: "" <>
Sent: Monday, August 12, 2013 3:13 AM
Subject: cql throw error when secondary timeuuid field use dateof()


I am trying to create a comments table. Which has primary key timeuuid and secondary field which also has timeuuid.

when I do query using funtion dateof() it throws error and i needed to reconnect again. But that query don't work at all.

cqlsh:demodb> select id,dateof(search_date) from news_comments;
TSocket read 0 bytes

it works fine if I do the same function for primarykey based timeuuid field

cqlsh:demodb> select id,dateof(created_date),search_date from news_comments;

 id  | dateof(created_date)     | search_date
 105 | 2013-08-12 02:46:33+0200 | a2bb29d1-02e8-11e3-bc81-fb4a940b08ec
 105 | 2013-08-12 02:46:36+0200 | a4abd641-02e8-11e3-bc81-fb4a940b08ec
 105 | 2013-08-12 02:46:41+0200 | a7790001-02e8-11e3-bc81-fb4a940b08ec
 105 | 2013-08-12 02:46:44+0200 | a943d4f1-02e8-11e3-bc81-fb4a940b08ec
 100 | 2013-08-07 05:35:47+0200 |                                 null
 100 | 2013-08-07 05:35:58+0200 |                                 null
 100 | 2013-08-07 05:35:59+0200 |                                 null
 100 | 2013-08-07 05:36:00+0200 |                                 null

In systemlog i get following error.

ERROR [Thrift:4] 2013-08-12 03:08:28,303 (line 217) Error occurred during processing of message.
    at org.apache.cassandra.utils.UUIDGen.getUUID(
    at org.apache.cassandra.cql3.functions.TimeuuidFcts$4.execute(
    at org.apache.cassandra.cql3.statements.Selection$FunctionSelector.compute(
    at org.apache.cassandra.cql3.statements.Selection$SelectionWithFunctions.handleRow(
    at org.apache.cassandra.cql3.statements.Selection$ResultSetBuilder.newRow(
    at org.apache.cassandra.cql3.statements.SelectStatement.handleGroup(
    at org.apache.cassandra.cql3.statements.SelectStatement.process(
    at org.apache.cassandra.cql3.statements.SelectStatement.processResults(
    at org.apache.cassandra.cql3.statements.SelectStatement.execute(
    at org.apache.cassandra.cql3.statements.SelectStatement.execute(
    at org.apache.cassandra.cql3.QueryProcessor.processStatement(
    at org.apache.cassandra.cql3.QueryProcessor.process(
    at org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(
    at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(
    at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(
    at org.apache.thrift.ProcessFunction.process(
    at org.apache.thrift.TBaseProcessor.process(
    at org.apache.cassandra.thrift.CustomTThreadPoolServer$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$ Source)
    at Source)