cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Stupp (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-9229) Add functions to convert timeuuid to date or time
Date Mon, 25 May 2015 16:15:17 GMT


Robert Stupp commented on CASSANDRA-9229:

Patch LGTM, just some nits.

* {{TimeFcts.dateOfFct.execute}} has superfluous line {{TimestampSerializer r = ((TimestampSerializer)
* Also mention in {{NEWS.txt}} that {{unixTimestampOf}} and {{dateOf}} are deprecated and
mention the functions to use instead.
* Can you add tests for {{maxTimeuuidFct}}, {{minTimeuuidFct}}, {{dateOfFct}}, {{unixTimestampOfFct}}
and {{now}}? Just to increase test coverage.

[~blerer] can you rebase your branch against current 2.2 branch? We can probably include it
in 2.2 - it's just new stuff (beside the two methods being deprecated).

> Add functions to convert timeuuid to date or time
> -------------------------------------------------
>                 Key: CASSANDRA-9229
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Michaël Figuière
>            Assignee: Benjamin Lerer
>              Labels: cql, doc-impacting
>             Fix For: 3.x
>         Attachments: CASSANDRA-9229-V2.txt, CASSANDRA-9229.txt
> As CASSANDRA-7523 brings the {{date}} and {{time}} native types to Cassandra, it would
be useful to add builtin function to convert {{timeuuid}} to these two new types, just like
{{dateOf()}} is doing for timestamps.
> {{timeOf()}} would extract the time component from a {{timeuuid}}. Example use case could
be at insert time with for instance {{timeOf(now())}}, as well as at read time to compare
the time component of a {{timeuuid}} column in a {{WHERE}} clause.
> The use cases would be similar for {{date}} but the solution is slightly less obvious,
as in a perfect world we would want {{dateOf()}} to convert to {{date}} and {{timestampOf()}}
for {{timestamp}}, unfortunately {{dateOf()}} already exist and convert to a {{timestamp}},
not a {{date}}. Making this change would break many existing CQL queries which is not acceptable.
Therefore we could use a different name formatting logic such as {{toDate}} or {{dateFrom}}.
We could then also consider using this new name convention for the 3 dates related types and
just have {{dateOf}} becoming a deprecated alias.

This message was sent by Atlassian JIRA

View raw message