You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Bill Speirs <bi...@gmail.com> on 2011/02/01 17:47:25 UTC

Row Key Types

What is the type of a Row Key? Can you define how they are compared?

I ask because I'm using TimeUUIDs as my row keys, but when I make a
call to get a range of row keys (get_range in phpcassa) I have to
specify the UTF8 range of '' to '99999999-9999-9999-9999-999999999999'
instead of the TimeUUID range of
'00000000-0000-0000-0000-000000000000' to
'ffffffff-ffff-ffff-ffff-ffffffffffff'.

This works, but feels wrong/inefficient... thoughts?

Thanks...

Bill-

Re: Row Key Types

Posted by "Wangpei (Peter)" <pe...@huawei.com>.
Did you set compare_with attribute of your ColumnFamily to TimeUUIDType?

-----邮件原件-----
发件人: Bill Speirs [mailto:bill.speirs@gmail.com] 
发送时间: 2011年2月2日 0:47
收件人: Cassandra Usergroup
主题: Row Key Types

What is the type of a Row Key? Can you define how they are compared?

I ask because I'm using TimeUUIDs as my row keys, but when I make a
call to get a range of row keys (get_range in phpcassa) I have to
specify the UTF8 range of '' to '99999999-9999-9999-9999-999999999999'
instead of the TimeUUID range of
'00000000-0000-0000-0000-000000000000' to
'ffffffff-ffff-ffff-ffff-ffffffffffff'.

This works, but feels wrong/inefficient... thoughts?

Thanks...

Bill-

Re: Row Key Types

Posted by Jonathan Ellis <jb...@gmail.com>.
How they are compared depends on the partitioner you are using.  For
BOP, it is lexical by byte order.

On Tue, Feb 1, 2011 at 8:47 AM, Bill Speirs <bi...@gmail.com> wrote:
> What is the type of a Row Key? Can you define how they are compared?
>
> I ask because I'm using TimeUUIDs as my row keys, but when I make a
> call to get a range of row keys (get_range in phpcassa) I have to
> specify the UTF8 range of '' to '99999999-9999-9999-9999-999999999999'
> instead of the TimeUUID range of
> '00000000-0000-0000-0000-000000000000' to
> 'ffffffff-ffff-ffff-ffff-ffffffffffff'.
>
> This works, but feels wrong/inefficient... thoughts?
>
> Thanks...
>
> Bill-
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com