Metadata
Metadata

Reputation: 2083

What happens to data when a Hbase table is dropped?

I am new to Hbase and learning it day by day. What happens to data when a Hbase table is dropped ? Are the data and schema lost or is there a scenario like Hive external table where the schema is lost and the data is preserved. Do Hbase has the same concept of Hive as External table and managed table.

Upvotes: 1

Views: 1468

Answers (1)

AdamSkywalker
AdamSkywalker

Reputation: 11609

For a simple observation, HBase table data consists of two parts:

  1. physical data blocks
  2. meta information (how data is spread across nodes)

HBase tables can share same physical blocks, for example you can make a snapshot of table A and restore it into table B, so both table will refer to the same data. If you delete a row in table A, it will only 'delete' meta info for table A, but not delete physical data for this row, because it is still referenced by table B.

So, answering your question, when you drop table you first delete meta info. If physical data is not referenced by any other table or snapshot it will be deleted too.

Upvotes: 4

Related Questions