Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 891661733F for ; Wed, 10 Jun 2015 12:29:09 +0000 (UTC) Received: (qmail 60077 invoked by uid 500); 10 Jun 2015 12:29:01 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 60035 invoked by uid 500); 10 Jun 2015 12:29:01 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 60023 invoked by uid 99); 10 Jun 2015 12:29:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2015 12:29:01 +0000 Date: Wed, 10 Jun 2015 12:29:01 +0000 (UTC) From: "Benjamin Lerer (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-9229) Add functions to convert timeuuid to date or time MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-9229?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Lerer updated CASSANDRA-9229: -------------------------------------- Attachment: 9229.txt The new patch add some extra unit tests and remove the unecessary line. It has been rebased for 2.2. I did not add a mention in the {{NEWS.txt}} because it was already in the {= {CHANGES.txt}}.=20 > Add functions to convert timeuuid to date or time > ------------------------------------------------- > > Key: CASSANDRA-9229 > URL: https://issues.apache.org/jira/browse/CASSANDRA-9229 > Project: Cassandra > Issue Type: New Feature > Reporter: Micha=C3=ABl Figui=C3=A8re > Assignee: Benjamin Lerer > Labels: cql, doc-impacting > Fix For: 2.2.0 rc2 > > Attachments: 9229.txt, CASSANDRA-9229-V2.txt, CASSANDRA-9229.txt > > > As CASSANDRA-7523 brings the {{date}} and {{time}} native types to Cassan= dra, 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}}. Exampl= e 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 t= o {{date}} and {{timestampOf()}} for {{timestamp}}, unfortunately {{dateOf(= )}} already exist and convert to a {{timestamp}}, not a {{date}}. Making th= is change would break many existing CQL queries which is not acceptable. Th= erefore we could use a different name formatting logic such as {{toDate}} o= r {{dateFrom}}. We could then also consider using this new name convention = for the 3 dates related types and just have {{dateOf}} becoming a deprecate= d alias. -- This message was sent by Atlassian JIRA (v6.3.4#6332)