Re: Scans and lexical sorting

2011-11-17 Thread Doug Meil
d definitely mention that startKey is inclusive and stopKey is >exclusive and start <= match < stop. > > >- Original Message - >From: Joe Pallas >To: user@hbase.apache.org >Cc: >Sent: Thursday, November 17, 2011 9:58 AM >Subject: Re: Scans and lexical sorti

Re: Scans and lexical sorting

2011-11-17 Thread lars hofhansl
y, November 17, 2011 9:58 AM Subject: Re: Scans and lexical sorting On Nov 16, 2011, at 9:17 AM, lars hofhansl wrote: > Hi Mark, > good find. I think that works by accident and the book is wrong. > "row" +  new byte[] {0} will use byte[].toString() and actually result in >

Re: Scans and lexical sorting

2011-11-17 Thread Joe Pallas
On Nov 16, 2011, at 9:17 AM, lars hofhansl wrote: > Hi Mark, > good find. I think that works by accident and the book is wrong. > "row" + new byte[] {0} will use byte[].toString() and actually result in > something like: "row[B@152b6651", which (again accidentally) sorts past rowN. > "row" + ne

Re: Scans and lexical sorting

2011-11-16 Thread Doug Meil
;,-1} > >We need to fix the book. > >-- Lars > > > >________________ >From: Mark >To: user@hbase.apache.org >Sent: Wednesday, November 16, 2011 7:59 AM >Subject: Scans and lexical sorting > >Section 5.7.3 of the HBase book displays a

Re: Scans and lexical sorting

2011-11-16 Thread lars hofhansl
better, though. You'd have to construct a byte array that is terminated by 255. An easy way to do that is: byte[] row = new byte[] {'r','o','w',-1} We need to fix the book. -- Lars From: Mark To: user@hbase.apache.org Sent: Wednes

Scans and lexical sorting

2011-11-16 Thread Mark
Section 5.7.3 of the HBase book displays a scan operation: HTable htable = ... // instantiate HTable Scan scan = new Scan(); scan.addColumn(Bytes.toBytes("cf"),Bytes.toBytes("attr")); scan.setStartRow( Bytes.toBytes("row")); scan.setStopRow( Bytes.toBytes("row" + new byte[] {0})); // note