I just discovered the answer..sorry for the spam :(

HTableDescriptor desc = new HTableDescriptor(tableName);
HColumnDescriptor hcd = new HColumnDescriptor(family);
hcd.setCompressionType(Algorithm.SNAPPY);
// Disable blooms (they are on by default as of 0.95) but we disable them
here because
// tests have hard coded counts of what to expect in block cache, etc., and
blooms being on is interfering.
hcd.setBloomFilterType(BloomType.NONE);
desc.addFamily(hcd);
Configuration c = new Configuration(conf);
HBaseAdmin hbaseAdmin = new HBaseAdmin(conf);
hbaseAdmin.createTable(desc);

Hope it could help someone else!

Best,
Flavio

On Tue, Jul 16, 2013 at 3:08 PM, Flavio Pompermaier <[email protected]>wrote:

> 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
>

Reply via email to