Support Questions

Find answers, ask questions, and share your expertise

How to compress existing hBase data using Snappy

avatar

Hi, I understand to compress existing HBase table we can use below technique..

disable 'SNAPPY_TABLE'

alter 'SNAPPY_TABLE',{NAME=>'cf1',COMPRESSION=>'snappy'}

enable 'SNAPPY_TABLE'

However did you find a way how to compress existing data, as only new data is getting compressed. Your help is much appreciated.

TIA,

Dheeraj Madan

1 ACCEPTED SOLUTION

avatar

@Dheeraj Madan

After altering the table you can run major compaction on the table from hbase shell so that existing data will be automatically compressed.

> major_compact 'SNAPPY_TABLE'

View solution in original post

3 REPLIES 3

avatar

@Dheeraj Madan

After altering the table you can run major compaction on the table from hbase shell so that existing data will be automatically compressed.

> major_compact 'SNAPPY_TABLE'

avatar

Thanks Rajesh

avatar
New Contributor

major_compact is not compressing existing data after altering the table to change compression from NONE to SNAPPY