Reputation: 113
I'm using the package 'org.apache.hadoop.hbase.client' for dataflow to manage Google's BigTable data.
Example to delete a row:
key = "PROV|CLI|800|20160714|8|30302.30301|ES";
byte[] byteKey = Bytes.toBytes(key);
Delete delete = new Delete(byteKey);
This works fine but I need a way to delete all rows that start with they key 'PROV|CLI|800|'
Is there anyway to do that?
Upvotes: 2
Views: 2170
Reputation: 2711
Cloud Bigtable has a feature to do this efficiently via AbstractBigtableAdmin. deleteRowRangeByPrefix(byte[])
:
Connection c = ...;
AbstractBigtableAdmin admin = (AbstractBigtableAdmin) c.getAdmin();
admin.deleteRowRangeByPrefix(Bytes.toBytes("PROV|CLI|800|"));
admin.close();
Upvotes: 7