Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # user >> Hbase rowkey question ?


+
praveenesh kumar 2011-06-10, 08:25
Copy link to this message
-
Re: Hbase rowkey question ?
> What is this "\x00\x00\x00\x00" thing. What does it represent ? How to
> interpret it ? Is '\x'  some kind of delimiter between 2 bytes ?
> Does it mean size of rowkey is 5 Bytes ?

Since HBase data is untyped, the shell tries to render everything as a
String. When it gets bytes that don't match characters, it encodes
each byte in hexadecimal with a leading \x. So, \x00\x00\x00\x00 is
the same as the full hexadecimal integer 0x00000000.

> Just I am wondering.. how can I get a particular row if I want ?.. I mean in
> regular rdbms we can search a row based on primary key.. how we can search a
> particular row here ?

For getting data, you need to type the keys in the same way. For
example, you can get row 0 from the table named test by typing the
following into the shell:

get 'test', '\x00\x00\x00\x00'

Also, if you type help in the shell, it will give you a more detailed
description of usage.

-Joey

On Fri, Jun 10, 2011 at 4:25 AM, praveenesh kumar <[EMAIL PROTECTED]> wrote:
> Hello guys..!!
>
> I am trying to understand hbase storing mechanism.
> but I am confused about hbase rowkey..
> HBASE WIKI says its a byte array. But the way its represented I am not able
> to understand that. I have set my row key as a byte array of int numbers..
> but when I am seeing it on hbase shell.. its coming in the following
> format...
>
> ROW                            COLUMN+CELL
>  \x00\x00\x00\x00              column=details:page, timestamp=1307693977866,
> value=/a.html
>  \x00\x00\x00\x01              column=details:page, timestamp=1307693977866,
> value=/
>  \x00\x00\x00\x02              column=details:page, timestamp=1307693977866,
> value=/
>  \x00\x00\x00\x03              column=details:page, timestamp=1307693977866,
> value=/b.html
>  \x00\x00\x00\x04              column=details:page, timestamp=1307693977866,
> value=/
>
> What is this "\x00\x00\x00\x00" thing. What does it represent ? How to
> interpret it ? Is '\x'  some kind of delimiter between 2 bytes ?
> Does it mean size of rowkey is 5 Bytes ?
> Just I am wondering.. how can I get a particular row if I want ?.. I mean in
> regular rdbms we can search a row based on primary key.. how we can search a
> particular row here ?
>
> Thanks,
> Praveenesh
>

--
Joseph Echeverria
Cloudera, Inc.
443.305.9434
+
Doug Meil 2011-06-10, 12:11
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB