hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Richard" <chris.rich...@gmail.com>
Subject Re: Object key sort
Date Fri, 19 Dec 2008 05:21:00 GMT
I think you can assign keys so that they sort by x.

You can 0-pad number strings on the left to get a consistent sortable format
(assuming HBase still only does an alphabetical sort of keys; if it supports
integer keys now you can just divide the upper and lower parts of the
integer to store the pair).

On Thu, Dec 18, 2008 at 8:51 PM, Edward J. Yoon <edwardyoon@apache.org>wrote:

> My key is a Segment(x, y). And, put(new Segment(int x, int
> y).getBytes(), columnName, data) to table.
>
> Segment.write() {
>  out.writeInt(this.x);
>  out.writeInt(this.y);
> }
>
> Then, key set is :
>
> [ (0, 0),
> (1, 0),
> (2, 0),
> (0, 1),
> (1, 1),
> ...]
>
> Could anyone give me some advice on how to get sorted set as grouped by x?
>
> [ (0, 0),
> (0, 1),
> (0, 2),
> (1, 0),
> (1, 1),
> ...]
>
> --
> Best Regards, Edward J. Yoon @ NHN, corp.
> edwardyoon@apache.org
> http://blog.udanax.org
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message