You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Tyler Hobbs (JIRA)" <ji...@apache.org> on 2014/08/06 01:37:12 UTC

[jira] [Commented] (CASSANDRA-7523) add date and time types

    [ https://issues.apache.org/jira/browse/CASSANDRA-7523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14086978#comment-14086978 ] 

Tyler Hobbs commented on CASSANDRA-7523:
----------------------------------------

Some initial thoughts:

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.

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.

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.

Comments on the patch:
* 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), Constants.Type

Definitely needs a lot of tests before committing (to whichever branch).

bq. Is it reasonable to consider the new Date and Time types DATETIME w/regards to PEP249?

I think it's reasonable for Date but not Time (although the PEP is kind of vague).

bq. I don't like changing the ui->time_format cqlshrc option underneath people but if we add a time type and time_format points to timestamp...

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.

> add date and time types
> -----------------------
>
>                 Key: CASSANDRA-7523
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7523
>             Project: Cassandra
>          Issue Type: Bug
>          Components: API
>            Reporter: Jonathan Ellis
>            Assignee: Joshua McKenzie
>            Priority: Minor
>             Fix For: 2.0.10
>
>
> http://www.postgresql.org/docs/9.1/static/datatype-datetime.html
> (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
(v6.2#6252)