Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HBase - difference between drop table and delete table?

Tags:

hbase

I am learning HBase shell commands and getting confused by drop and delete table.

Could anyone comment on the difference between dropping a table and deleting a table?

thanks.

like image 954
Eric H. Avatar asked Dec 10 '25 08:12

Eric H.


1 Answers

There's no difference. I speculate that the reason for the two names is because HBaseAdmin was created first, and it used "delete". Then when the shell was created folks realized that drop table tablename is the standard way to get rid of a table.*

But I confirm (regardless of the speculation into its origin) that they are the same by looking at the HBase Admin source file admin.rb:

# Drops a table
def drop(table_name)
  tableExists(table_name)
  raise ArgumentError, "Table #{table_name} is enabled. Disable it first.'" if enabled?(table_name)
  @admin.deleteTable(table_name)
end

*But to be precise... they did not go with drop table tablename but rather drop 'tablename' in the HBase shell.

like image 90
mdahlman Avatar answered Dec 14 '25 01:12

mdahlman