incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Parker <...@socialagency.com>
Subject Re: Querying by date range when using TimeUUIDType ColumnFamily?
Date Tue, 27 Apr 2010 21:23:20 GMT
I have used the solution presented by Justin and it works just fine.  When
you construct a TimeUUID with a specific timestamp and use that for the
start or finish of the range slice, cassandra will use the timestamp
embedded in the UUID even if that specific UUID doesn't exist in the index.
 It is not an ideal solution because the timestamp you pass in may not have
the same granularity as the one used to create your current indexes.  So,
you might be using a standard unix epoch timestamp in seconds, while a true
TimeUUID uses 100 nanosecond slices of time.

Lee Parker
On Tue, Apr 27, 2010 at 3:29 PM, Lucas Di Pentima
<lucas@di-pentima.com.ar>wrote:

> I think what Ed asked is that having some CF with TimeUUIDType allowed him
> to call get_slice with *any* date range, even though those values weren't
> inserted in Cassandra.
>
> I'm just a newbie here, but I think that this is not possible, and to do
> just that you have to construct an additional index, maybe with this format:
>
> DateRange = { // CF - TimeUUIDType
> YYYYMMDD : { // Row, keyed by day, for example
> time_uuid1 => nil,
> time_uuid2 => nil,
> time_uuid3 => nil,
> ...
> }
> }
>
> ...being time_uuid[123], the actual column names inserted in the other CF.
>
> Is this correct?
>
> Regards
>
> El 27/04/2010, a las 16:50, Justin Sanders escribió:
>
> You're going to have to build TimeUUIDs based on the date range you are
> scanning.  Problem is most UUID libraries build version 1 UUIDs based on the
> current time.  I was able to get this working in Python by changing the
> library to allow me to pass in a time.  This isn't safe for creating unique
> UUIDs but works fine for doing slices.
>
> Justin
>
>
> On Tue, Apr 27, 2010 at 11:28 AM, Ed Anuff <ed@anuff.com> wrote:
>
>> Assuming a ColumnFamily with a CompareWith of TimeUUIDType, is it possible
>> to call get_slice with an arbitrary date range?  How would valid values for
>> the start and finish attributes of the slice range be constructed?
>>
>> Thanks
>> Ed
>>
>
>
> --
> Lucas Di Pentima - Santa Fe, Argentina
> Jabber: lucas@di-pentima.com.ar
> MSN: ldipenti75@hotmail.com
>
>
>
>
>

Mime
View raw message