views:

22

answers:

1

I can tell hbase to disable and delete particular tables using:

disable 'tablename'
delete 'tablename'

But I want to delete all the tables in the database without hardcoding the names of any of the tables. Is there a way to do this? I want to do this through the command-line utility ./hbase shell, not through Java or Thrift.

+1  A: 

You can pipe commands to the bin/hbase shell command. From there you can use some scripting to grab the table names and pipe the disable/delete commands back to hbase.

i.e.

echo "list" | bin/hbase shell | ./filter_table_names.pl > table_names.txt
./turn_table_names_into_disable_delete_commands.pl table_names.txt | bin/hbase shell 
bajafresh4life
Yes, but that depends on what output the hbase shell provides. I was hoping hbase would have something built-in.
Goose Bumper
You won't find that functionality from the shell and baja's method is about as close as you'll get. I don't think there are much in the way of plans to improve the current shell(which is pretty bad). I'm aware you want to avoid thrift/java but maybe if you can post your reasons for avoiding them another alternative could be suggested?
juhanic