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

Switch to Threaded View
HBase, mail # user - Programmatically create HTable with snappy-compressed columns


Copy link to this message
-
RE: Programmatically create HTable with snappy-compressed columns
Vladimir Rodionov 2013-07-16, 18:00
Here it is (the simplest one):

                HColumnDescriptor fam = new HColumnDescriptor(familyName);
                fam.setCompressionType(Algorithm.SNAPPY);
                HTableDescriptor table = new HTableDescriptor(tableName);
                table.addFamily(fam);
                HBaseAdmin admin = new HBaseAdmin(HBaseConfiguration.create());
                admin.createTable(table);

Best regards,
Vladimir Rodionov
Principal Platform Engineer
Carrier IQ, www.carrieriq.com
e-mail: [EMAIL PROTECTED]

________________________________________
From: Flavio Pompermaier [[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2013 6:08 AM
To: [EMAIL PROTECTED]
Subject: Programmatically create HTable with snappy-compressed columns

Hi to all,
I have to programmatically create HTable (from Java) with a compressed
(snappy) column.
Is it possible to do it from code or do I have to manually create them via
hbase shell?
If it is possible could someone show me a snippet?

Best,
Flavio

Confidentiality Notice:  The information contained in this message, including any attachments hereto, may be confidential and is intended to be read only by the individual or entity to whom this message is addressed. If the reader of this message is not the intended recipient or an agent or designee of the intended recipient, please note that any review, use, disclosure or distribution of this message or its attachments, in any form, is strictly prohibited.  If you have received this message in error, please immediately notify the sender and/or [EMAIL PROTECTED] and delete or destroy any copy of this message and its attachments.