hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: Schema migration in Hbase
Date Thu, 16 Oct 2014 08:27:21 GMT
How many rows are there in test1 table ?

Please consider approach #1 for efficiency. 

Cheers

On Oct 15, 2014, at 10:24 PM, Vimal Jain <vkjk89@gmail.com> wrote:

> Hi,
> I have a hbase table( say test1) with 3 cfs ( a,b,c) and i have bunch of
> cqs in each of these cf.
> I also have one more table ( say test2) with some cfs on same cluster.
> My requirement is to move data from test1 to test2 through my custom logic
> ( as in which cf:cq from test1 will go to which cf:cq in test2).
> I thought there are ways 2 achieve this.
> 
> 1) Writing some Java client code to perform "get" on test1 and perform
> "put" on test2.
> 2) Through writing a Jruby script and executing it on hbase shell.
> 
> I preferred the 2nd way and started writing the script.
> i wrote something like this
> 
> for ( all rowkeys in test1)
> do
> somevariable = get 'test1' , '1' ,'a:abc'
> put 'test2' ,'1','a:abc',somevariable
> done
> 
> 
> But its not working(Sometimes syntax error , sometimes empty value is put
> into test2 ) .I am new to Jruby scripting , so please redirect me to any
> tutorial/blog which can help me achieve this.
> 
> I am using hbase 0.94.17.
> 
> -- 
> Thanks and Regards,
> Vimal Jain

Mime
View raw message