cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Fisk...@littleshoot.org>
Subject Re: date range queries
Date Wed, 16 Dec 2009 03:35:21 GMT
This is still baffling me a bit, Jonathan. I'm running from a trunk
snapshot from a few days ago (2009-12-07).

I'm creating time UUIDs using "JUG" (http://jug.safehaus.org/) as my
SuperColumn key names for batch_insert calls. That seems excessive but
works - the only Java lib I found for creating time-based UUIDs. I'm
successfully calling batch_insert using those UUID bytes as my
SuperColumn names. I think this is correct, but please correct me if
not.

Then, however, I can't figure out how to get any more than data for a
single SuperColumn from get_slice. It seems the way to do this would
be to specify a ColumnParent that only contains a ColumnFamily. When I
do this, however, I get the following exception:

InvalidRequestException(why:UUIDs must be exactly 16 bytes)
	at org.apache.cassandra.service.Cassandra$get_slice_result.read(Cassandra.java:3170)
	at org.apache.cassandra.service.Cassandra$Client.recv_get_slice(Cassandra.java:170)
	at org.apache.cassandra.service.Cassandra$Client.get_slice(Cassandra.java:144)

If I specify a SuperColumn name in the ColumnParent, I can get Columns
for just that SuperColumn, but I'm attempting to get a slice of
SuperColumns. Am I misunderstanding something? Is that a bug?

Thanks very much.

-Adam


On Wed, Nov 18, 2009 at 8:23 PM, Jonathan Ellis <jbellis@gmail.com> wrote:
> The easiest is to store the messages in a row with timeuuid column
> names.  Then you can just use get_slice in either forward or reverse
> order.
>
> On Wed, Nov 18, 2009 at 6:07 PM, Adam Fisk <a@littleshoot.org> wrote:
>> First off, very impressive project -- thanks for everyone's hard work!
>> I'm wondering how I would do date range queries in Cassandra, say for
>> all messages for a given user in the last week.
>>
>> Can someone provide an example?
>>
>> Thanks so much.
>>
>> -Adam
>>
>> --
>> Adam Fisk
>> http://www.littleshoot.org | http://adamfisk.wordpress.com |
>> http://twitter.com/adamfisk
>>
>



-- 
Adam Fisk
http://www.littleshoot.org | http://adamfisk.wordpress.com |
http://twitter.com/adamfisk

Mime
View raw message