Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to compress existing hBase data using Snappy

Solved Go to solution
Highlighted

How to compress existing hBase data using Snappy

New Contributor

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

Accepted Solutions

Re: How to compress existing hBase data using Snappy

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

3 REPLIES 3

Re: How to compress existing hBase data using Snappy

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

Re: How to compress existing hBase data using Snappy

New Contributor

Thanks Rajesh

Re: How to compress existing hBase data using Snappy

New Contributor

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

Don't have an account?
Coming from Hortonworks? Activate your account here