Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When truncate HBase Table Splits get removed

Tags:

hbase

I created a Table namely DEMO_TABLE and inserted some data, but I wanted to clear out that table for that,

truncate "DEMO_TABLE"

But this removes all pre-splits given to that Table. Can Anybody explain this behavior?

like image 288
iamLalit Avatar asked Aug 17 '17 13:08

iamLalit


People also ask

What does truncate do in HBase?

The TRUNCATE statement deletes all data files from an Hadoop table. The table cannot be a Db2® local table or an HBase table.

What is HBase shell?

HBase contains a shell using which you can communicate with HBase. HBase uses the Hadoop File System to store its data. It will have a master server and region servers. The data storage will be in the form of regions (tables).


1 Answers

If you are using HBase 0.98 or greater version, you can use truncate_preserve command in HBase shell. This will retain the previous region boundaries defined by the pre-split.

like image 52
Subash Kunjupillai Avatar answered Oct 06 '22 23:10

Subash Kunjupillai