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

Switch to Threaded View
HBase >> mail # user >> PreSplit the table with Long format

Copy link to this message
Re: PreSplit the table with Long format
Hello again,

Doesn't anyone know how I can do this.
The problem is:
When you insert something from the shell, it supposes it's a string and
then does a Bytes.toBytes conversion on the string and stores it in hbase.
So how can I tell the shell that the thing I'm entering isn't a string? How
I can put a value with a long format inside hbase, through the shell.

If you need to know, I want to pre-split my table. I can't do it through
java code, because I've installed a security library on hbase, with which I
can create encrypted tables. It adds a "securecreate" command to the shell,
from which I can create encrypted tables, but I can't create encrypted
tables with the java code. So I'm forced to use the shell to create the
table, and I want to pre-split my table with long values, because my row
keys are in the long format.

Please help, I really need this.

On Tue, Feb 19, 2013 at 2:12 PM, Farrokh Shahriari <

> Tnx for your help,but it doesn't work.Do you have any other idea,cause I
> must run it from the shell.
> Farrokh
> On Tue, Feb 19, 2013 at 1:30 PM, Viral Bajaria <[EMAIL PROTECTED]>wrote:
>> HBase shell is a jruby shell and so you can invoke any java commands from
>> it.
>> For example:
>> > import org.apache.hadoop.hbase.util.Bytes
>> > Bytes.toLong(Bytes.toBytes(1000))
>> Not sure if this works as expected since I don't have a terminal in front
>> of me but you could try (assuming the SPLITS keyword takes byte array as
>> input, never used SPLITS from the command line):
>> create 'testTable', 'cf1' , { SPLITS => [ Bytes.toBytes(1000),
>> Bytes.toBytes(2000), Bytes.toBytes(3000) ] }
>> Thanks,
>> Viral
>> On Tue, Feb 19, 2013 at 1:52 AM, Farrokh Shahriari <
>> [EMAIL PROTECTED]> wrote:
>> > Hi there
>> > As I use rowkey in long format,I must presplit table in long format
>> too.But
>> > when I've run this command,it presplit the table with STRING format :
>> > create 'testTable','cf1',{SPLITS => [ '1000','2000','3000']}
>> >
>> > How can I presplit the table with Long format ?
>> >
>> > Farrokh
>> >