Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

How to compress existing hBase data using Snappy

avatar
New Member

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

Thanks Rajesh

avatar
New Member

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