Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> Problem with HFile lexical comparison

Copy link to this message
Re: Problem with HFile lexical comparison
RawComparator just does raw bytes?  You need a Comparator that understands
the KV format.  See KV class.  Otherwise, post your code. It seems like you
are skirting checks the hfile hosting Store in hbase does.

On Wed, Jun 19, 2013 at 10:05 AM, Rohit Kelkar <[EMAIL PROTECTED]>wrote:

> Here is a problem that I am facing while creating an HFile outside of a MR
> job.
> My column family is "sd"
> For a given rowKey=10011-2-0000000000000000703, this is the sequence in
> which I am writing KeyValue pairs to the HFile,
> key=sd:dt, value="dummy value 1"
> key=sd:dth, value="dummy value 2"
> When I print the keys it prints the following for the above 2 entries
> \x00\x1B10011-2-0000000000000000703\x02sddt\x7F\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x04
> \x00\x1B10011-2-0000000000000000703\x02sddth\x7F\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x04
> When I write the KV to HFile it throws an IOException:
> Added a key not lexically larger than previous
> key=\x00\x1B10011-2-0000000000000000703\x02sddth\x7F\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x04,
> lastkey=\x00\x1B10011-2-0000000000000000703\x02sddt\x7F\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x04
> Lexically "sd:dt" is smaller than "sd:dth" then why should HFile
> (AbstractHFileWriter.checkKey) complain? The checkKey method is using the
> hadoop RawComparator
> Am I missing something?
> - R