You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Sri Ramya <ra...@gmail.com> on 2013/04/19 13:32:10 UTC

CQL

hi,

 I am working with CQl. I want perform query base on timestamp. Can anyone
help me out of this how to get date great than or less than a given time
timestamp in cassandra.

Re: CQL

Posted by David McNelis <dm...@gmail.com>.
In order to do a query like that you'll need to have a timestamp/date as
the second portion of the primary key.

You'll only be able to do queries where you already know the key.  Unless
you're using an OrderPreservingPartitioner, there is no way to get a
continuous set of information back based on the key for the row (the first
key if you have a multi-column primary key).

I suggest you take a read of this DataStax post about time series data:
http://www.datastax.com/dev/blog/advanced-time-series-with-cassandra

Last, this is definitely a message better served by the user list and not
the dev list (which is primarily for communication about development
efforts of cassandra).

Good luck.


On Fri, Apr 19, 2013 at 1:06 PM, Sri Ramya <ra...@gmail.com> wrote:

> Please can any body help me to solve the above problem. I stuck with that
> problem in my project. help me
>

Re: CQL

Posted by Duc Quoc <du...@gmail.com>.
I tried Googling the question but it seems there is no relevant result for
CQL. You may try raw API or some higher-level API like Hector/Astyanax:
http://stackoverflow.com/questions/4538123/fetching-records-withing-given-range-of-timestamp-from-cassandra
http://gettingstartedwithcassandra.blogspot.com/2011/06/cassandra-hector-api-querying-by.html

--Duc


On Sat, Apr 20, 2013 at 1:06 AM, Sri Ramya <ra...@gmail.com> wrote:

> Please can any body help me to solve the above problem. I stuck with that
> problem in my project. help me
>



-- 
“*Engineering isn't about
perfect<http://sphotos-a.ak.fbcdn.net/hphotos-ak-prn1/527227_264640590317983_1661758052_n.jpg>solutions;
it's about doing the best you can with
limited<http://sphotos-d.ak.fbcdn.net/hphotos-ak-prn1/486544_264672746981434_509694703_n.jpg>resources.
*” - Randy Pausch

Re: CQL

Posted by Sri Ramya <ra...@gmail.com>.
Please can any body help me to solve the above problem. I stuck with that
problem in my project. help me

Re: CQL

Posted by Michael Theroux <mt...@yahoo.com>.
A lot more details on your usecase and requirements would help.  You need to make specific considerations in cassandra when you have requirements around ordering.  Ordering can be achieved across columns.  Ordering across rows is a bit more tricky and may require the use of specific partitioners...

I did a real quick google search on "cassandra ordering" and found some good links (http://ayogo.com/blog/sorting-in-cassandra/).

To do queries with ordering across columns, using the "FIRST" keyword will return results based on the comparator you defined in your schema:

http://cassandra.apache.org/doc/cql/CQL.html#SELECT

Hope this helps,
-Mike

On Apr 19, 2013, at 7:32 AM, Sri Ramya wrote:

> hi,
> 
>  I am working with CQl. I want perform query base on timestamp. Can anyone help me out of this how to get date great than or less than a given time timestamp in cassandra.


Re: CQL

Posted by Sri Ramya <ra...@gmail.com>.
Please can any body help me to solve the above problem. I stuck with that
problem in my project. help me