Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 238B110892 for ; Wed, 23 Oct 2013 10:22:17 +0000 (UTC) Received: (qmail 78418 invoked by uid 500); 23 Oct 2013 10:22:14 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 78073 invoked by uid 500); 23 Oct 2013 10:22:13 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 78065 invoked by uid 99); 23 Oct 2013 10:22:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Oct 2013 10:22:12 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [178.32.125.228] (HELO mo6.mail-out.ovh.net) (178.32.125.228) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Oct 2013 10:22:03 +0000 Received: from mail635.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo6.mail-out.ovh.net (Postfix) with SMTP id 203B8FFA7B3 for ; Wed, 23 Oct 2013 12:22:03 +0200 (CEST) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 23 Oct 2013 12:27:32 +0200 Received: from unknown (HELO elia.xerus.net?echo-net.net?x-echo.com?s1.p.fti.net) (cscetbon@atid.fr@193.252.149.222) by ns0.ovh.net with SMTP; 23 Oct 2013 12:27:31 +0200 From: Cyril Scetbon Content-Type: multipart/alternative; boundary="Apple-Mail=_7CE7F5D4-05E8-49D3-8483-37A5E6D0C357" Message-Id: <49564C8A-0AA6-4BC5-840C-712C9480E034@free.fr> Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Subject: Re: How to select timestamp with CQL Date: Wed, 23 Oct 2013 12:21:34 +0200 References: To: user@cassandra.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1816) X-Ovh-Tracer-Id: 11858822245178853334 X-Ovh-Remote: 193.252.149.222 () X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: 0 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeiledrfeekucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeiledrfeekucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_7CE7F5D4-05E8-49D3-8483-37A5E6D0C357 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Hi, Now you can ask for the TTL and the TIMESTAMP as shown in the following = example : cqlsh:k1> select * FROM t1 ; ise | filtre | value_1 --------+--------+--------- cyril1 | 2 | 49926 cyril2 | 1 | 18584 cyril3 | 2 | 31415 cqlsh:k1> select filtre,writetime(filtre),ttl(filtre) FROM t1 ; filtre | writetime(filtre) | ttl(filtre) --------+-------------------+------------- 2 | 1380088288623000 | null 1 | 1380088288636000 | null 2 | 1380088289309000 | null Regards --=20 Cyril SCETBON On 23 Oct 2013, at 12:00, Alex N wrote: > Hi, > I was wondering how could I select column timestamp with CQL. I've = been using Hector so far, and it gives me this option. But I want to use = datastax CQL driver now.=20 > I don't want to mess with this value! just read it. I know I should = probably have separate column with timestamp value created by my own, = but I don't want to change the schema and update milions of rows know. > I found this ticket = https://issues.apache.org/jira/browse/CASSANDRA-4217 and it's fixed but = I don't know how to use it -=20 > SELECT key, value, timestamp(value) FROM foo; - this doesn't work. > Regards, > Alex >=20 >=20 --Apple-Mail=_7CE7F5D4-05E8-49D3-8483-37A5E6D0C357 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 Hi,

Now you can ask for the TTL = and the TIMESTAMP as shown in the following example = :

cqlsh:k1> select * FROM t1 ;

 ise  =   | filtre | = value_1
--------+--------+---------
 cyril1 |      = 2 |   49926
 cyril2 |      1 |   18584
 cyril3 |      2 |   31415

cqlsh:k1> = select filtre,writetime(filtre),ttl(filtre) FROM t1 ;

 filtre | = writetime(filtre) | = ttl(filtre)
--------+-------------------+-------------
  =     2 |  = 1380088288623000 |  =       null
      11380088288636000 |        = null
  =     2 |  = 1380088289309000 |  =       null

-- 
Cyril SCETBON

On 23 Oct 2013, at 12:00, Alex N <lotqua@gmail.com> = wrote:

Hi,
I was wondering how could I select column timestamp with CQL. I've been=20= using Hector so far, and it gives me this option. But I want to use=20 datastax CQL driver now.
I don't want to mess with this value! just read it. I know I should=20 probably have separate column with timestamp value created by my own,=20 but I don't want to change the schema and update milions of rows = know.
I found this ticket https://issu= es.apache.org/jira/browse/CASSANDRA-4217 and it's fixed but I don't = know how to use it -
SELECT key, value, =
timestamp(value) FROM foo; - this doesn't =
work.
Regards,
Alex


= --Apple-Mail=_7CE7F5D4-05E8-49D3-8483-37A5E6D0C357--