You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Geovanie Marquez <ge...@gmail.com> on 2013/11/09 16:22:47 UTC

Copy Hbase Table Schema

I have to rebuild a test database elsewhere in production and I have about
50 columns in one column family. I would rather not define the schema
manually.

Could I somehow build the tables in another node without manually typing
each column?

Thanks,
Geo

Re: Copy Hbase Table Schema

Posted by Geovanie Marquez <ge...@gmail.com>.
Had to modify the shell syntax so that:

   1. 'table' is declared after create
   2. Treated NAMES separately
   3. Got rid of 'FAMILIES'

hbase(main):003:0> create 'table', {NAME => 'table', SPLIT_POLICY =>
'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy'},
{NAME => 'd', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE',
REPLICATION_SCOPE => '0', VERSIONS => '2147483647', COMPRESSION => 'NONE',
MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false',
BLOCKSIZE => '65536', IN_MEMORY => 'false', ENCODE_ON_DISK => 'true',
BLOCKCACHE => 'true'}
0 row(s) in 2.3230 seconds



On Sat, Nov 9, 2013 at 12:12 PM, Geovanie Marquez <
geovanie.marquez@gmail.com> wrote:

> I error out when creating the table off of the describe statement. I tried
> other variations of the same and get the same error.
>
> hbase(main):015:0> create {NAME => 'table', SPLIT_POLICY =>
> 'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy',
> FAMILIES => [{NAME => 'd', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER =>
> 'NONE', REPLICATION_SCOPE => '0', VERSIONS => '2147483647', COMPRESSION
> => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS
> => 'false', BLOCKSIZE => '65536', IN_MEMORY => 'false', ENCODE_ON_DISK =>
> 'true', BLOCKCACHE => 'true'}]}
> SyntaxError: (hbase):15: syntax error, unexpected tASSOC
>
> create {NAME => 'table', SPLIT_POLICY =>
> 'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy',
> FAMILIES => [{NAME => 'd', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER =>
> 'NONE', REPLICATION_SCOPE => '0', VERSIONS => '2147483647', COMPRESSION
> => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS
> => 'false', BLOCKSIZE => '65536', IN_MEMORY => 'false',
>                                                                      ^
> ENCODE_ON_DISK => 'true', BLOCKCACHE => 'true'}]}
>
>
>
>
> On Sat, Nov 9, 2013 at 10:42 AM, Ted Yu <yu...@gmail.com> wrote:
>
>> Please take a look at http://hbase.apache.org/book.html#table_variablesfor
>> usage of 'describe' command.
>>
>>
>> On Sat, Nov 9, 2013 at 7:22 AM, Geovanie Marquez <
>> geovanie.marquez@gmail.com
>> > wrote:
>>
>> > I have to rebuild a test database elsewhere in production and I have
>> about
>> > 50 columns in one column family. I would rather not define the schema
>> > manually.
>> >
>> > Could I somehow build the tables in another node without manually typing
>> > each column?
>> >
>> > Thanks,
>> > Geo
>> >
>>
>
>

Re: Copy Hbase Table Schema

Posted by Geovanie Marquez <ge...@gmail.com>.
I error out when creating the table off of the describe statement. I tried
other variations of the same and get the same error.

hbase(main):015:0> create {NAME => 'table', SPLIT_POLICY =>
'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy',
FAMILIES => [{NAME => 'd', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER =>
'NONE', REPLICATION_SCOPE => '0', VERSIONS => '2147483647', COMPRESSION =>
'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS =>
'false', BLOCKSIZE => '65536', IN_MEMORY => 'false', ENCODE_ON_DISK =>
'true', BLOCKCACHE => 'true'}]}
SyntaxError: (hbase):15: syntax error, unexpected tASSOC

create {NAME => 'table', SPLIT_POLICY =>
'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy',
FAMILIES => [{NAME => 'd', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER =>
'NONE', REPLICATION_SCOPE => '0', VERSIONS => '2147483647', COMPRESSION =>
'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS =>
'false', BLOCKSIZE => '65536', IN_MEMORY => 'false',
                                                                     ^
ENCODE_ON_DISK => 'true', BLOCKCACHE => 'true'}]}




On Sat, Nov 9, 2013 at 10:42 AM, Ted Yu <yu...@gmail.com> wrote:

> Please take a look at http://hbase.apache.org/book.html#table_variablesfor
> usage of 'describe' command.
>
>
> On Sat, Nov 9, 2013 at 7:22 AM, Geovanie Marquez <
> geovanie.marquez@gmail.com
> > wrote:
>
> > I have to rebuild a test database elsewhere in production and I have
> about
> > 50 columns in one column family. I would rather not define the schema
> > manually.
> >
> > Could I somehow build the tables in another node without manually typing
> > each column?
> >
> > Thanks,
> > Geo
> >
>

Re: Copy Hbase Table Schema

Posted by Ted Yu <yu...@gmail.com>.
Please take a look at http://hbase.apache.org/book.html#table_variables for
usage of 'describe' command.


On Sat, Nov 9, 2013 at 7:22 AM, Geovanie Marquez <geovanie.marquez@gmail.com
> wrote:

> I have to rebuild a test database elsewhere in production and I have about
> 50 columns in one column family. I would rather not define the schema
> manually.
>
> Could I somehow build the tables in another node without manually typing
> each column?
>
> Thanks,
> Geo
>