cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua McKenzie (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-7523) add date and time types
Date Sun, 14 Sep 2014 20:29:34 GMT


Joshua McKenzie commented on CASSANDRA-7523:

V1 of the changes is ready for review.

[Cassandra changes|]
[Python driver changes|]

Do we really want to add this in 2.0? This is fairly isolated, but it would be nice to not
introduce new bugs this late in 2.0.
Rebased to 2.1.  I agree.

Should we be storing dates as four bytes and a days-since-epoch format like postgres? This
would be more compact and allow for a wider range of supported dates.
Rewrote based on Integertype, days since epoch.  I used joda for date parsing and formatting
- the built-in java date libraries have a variety of problems that didn't make them suitable
candidates for this work (thread-safety, non-proleptic by default, etc)

I feel pretty strongly that the time type should support microsecond resolution, even if we
can't provide microsecond resolution with functions/special values like now until Java 8.
I went with nanoseconds since midnight.  It adds the complexity of serialization to and from
string but should add little as far as data footprint on disk with compression enabled and
this prevents us from having to rework a higher resolution type down the line (see CASSANDRA-7536)

I wouldn't accept a millis-since-epoch string for dateStringToDate()

TimeType should not be compatible with DateType and TimestampType (nor should SimpleDateType
if we use a four-byte format)

I would use "date" instead of "simpledate" in a few places: CQL3Types.Native, Cql3.g (K_SIMPLEDATE),
Done.  I also updated the CQL html help docs to reflect a more consistent naming scheme (timestamp,
date, time)

Definitely needs a lot of tests before committing (to whichever branch).
Tests for types, serialization, cqlshlib, types in python driver, and integration tests on
driver added.  Let me know if you can think of anything else that could use some testing in
this context.

We do want to leave the format the same for timestamps. I would add a new format option for
the "time" type and leave the existing one for timestamps.

Once we get the java side ironed out I'll get the ball rolling on python driver change review/integration
and open another ticket to update the bundled driver to support these new types.

> add date and time types
> -----------------------
>                 Key: CASSANDRA-7523
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Jonathan Ellis
>            Assignee: Joshua McKenzie
>            Priority: Minor
>             Fix For: 2.1.1, 3.0
> (we already have timestamp; interval is out of scope for now, and see CASSANDRA-6350
for discussion on timestamp-with-time-zone.  but date/time should be pretty easy to add.)

This message was sent by Atlassian JIRA

View raw message