Trying to truncate tables like this
list.each{|name| truncate(name) if name.end_with?('abc123')}
won't work. How would one approach this?
In HBase shell you can also do:
java_import org.apache.hadoop.hbase.client.HBaseAdmin
java_import org.apache.hadoop.hbase.HBaseConfiguration
admin = HBaseAdmin.new(HBaseConfiguration.create)
admin.listTables.each {|i| t=i.getNameAsString; truncate(t) if t.end_with?('abc123')}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With