I'm using the HBase API to access Google Cloud Bigtable, but whenever I try to delete a column:
Delete delete = new Delete(r.getRow());
java.lang.UnsupportedOperationException: Cannot delete single latest cell.
Sorry for your troubles. Bigtable and HBase differ in a couple of ways, and this is one of them.
Delete delete = new Delete(rowKey); delete.addColumns(COLUMN_FAMILY, qual); // the 's' matters table.delete(delete);
Delete.addColumn deletes only the latest cell from the column. The
Delete.addColumn_s_ means delete all cells (i.e. all the various timestamps). Alternatively, you can delete a specific cell via
Delete.addColumn(byte, byte, long) where the
long is a timestamp.
The hbase shell delete uses
deleteColumns which maps to
addColumns under the cover. It also uses the
s variation, which is why it works.
For reference here is our complete TestDelete suite which identify the use case you present as
@Category(KnownGap.class) which we use to identify differences missing HBase features in the Bigtable client.