cassandra-client-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Miles <selimna...@gmail.com>
Subject timestamp and timeuuid strangeness
Date Tue, 12 May 2015 03:33:27 GMT
Hello,

I'm seeing strange things when storing both timestamp and timeuuid columns
from the C API using prepared statements.  For example, I have some data
starting at 1/1/1981.  The unix timestamp for this is 347173200, which I
can get out of my table as follows:

> select UNIXTIMESTAMPOF(date) from variables_by_date_patch limit 1;

 UNIXTIMESTAMPOF(date)
-----------------------
             347173200

However, when looking at the same data as a date:

> select DATEOF(date) from variables_by_date_patch limit 1;

 DATEOF(date)
--------------------------
 1970-01-04 19:26:13-0500

My table is defined as:

> describe table variables_by_date_patch;

CREATE TABLE variables_by_date_patch (
    variable text,
    date timeuuid,
    patchid text,
    value double,
    PRIMARY KEY (variable, date, patchid)
) WITH CLUSTERING ORDER BY (date ASC, patchid ASC)

I'm using Cassandra 2.1.5 running on Debian 7.  The data were written using
the latest version of the C API (
https://github.com/datastax/cpp-driver/commit/3310ab178d1188d5e85c03964247667be6db520c
).

Any hints would be greatly appreciated.

Thanks,

Brian

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message