You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by "Armaselu, Cristian" <ca...@epsilon.com> on 2014/08/18 23:19:32 UTC

hbase is not deleting the cell when a Put with a KeyValue, KeyValue.Type.Delete is submitted

Hello,

We're running Hbase 0.96.1.1 under CDH5.0.2 and we're seeing a different behavior than with CDH 4.8 (Hbase .94.xx)

Running the code below is creating an empty cell instead of no cell for this line of code
        String tname = "my_test";
        Configuration configuration = HBaseConfiguration.create();
        HBaseAdmin baseAdmin = new HBaseAdmin(configuration);
        baseAdmin.disableTable(tname);
        baseAdmin.deleteTable(tname);
        TableName tableName = TableName.valueOf(tname);
        HTableDescriptor tableDescriptor = new HTableDescriptor(tableName);
        HColumnDescriptor columnDescriptor = new HColumnDescriptor("default");
        tableDescriptor.addFamily(columnDescriptor);
        baseAdmin.createTable(tableDescriptor);
        final String rowKey = "12345";
        final Put p = new Put(Bytes.toBytes(rowKey));
        for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 6; i++) {
                final byte[] family = Bytes.toBytes("default");
                final byte[] column = Bytes.toBytes("c" + i);
                if (i == 5) {
                    p.add(new KeyValue(p.getRow(), family, column, HConstants.LATEST_TIMESTAMP, KeyValue.Type.Delete));
                } else {
                    p.add(family, column, Bytes.toBytes("c" + i + "_value_" + (j+1)));
                }
            }
        }
        HTableInterface table = new HTable(configuration, tableName);
        table.put(p);

hbase shell

hbase(main):003:0* scan 'my_test'
ROW                                                 COLUMN+CELL
 12345                                              column=default:c0, timestamp=1408396641845, value=c0_value_3
 12345                                              column=default:c1, timestamp=1408396641845, value=c1_value_3
 12345                                              column=default:c2, timestamp=1408396641845, value=c2_value_3
 12345                                              column=default:c3, timestamp=1408396641845, value=c3_value_3
 12345                                              column=default:c4, timestamp=1408396641845, value=c4_value_3
 12345                                              column=default:c5, timestamp=1408396641845, value=
1 row(s) in 0.3580 seconds

Is there any way we can get the old behavior back?
To be more exact I expect the hbase shell scan to return the following:

hbase(main):003:0* scan 'my_test'
ROW                                                 COLUMN+CELL
 12345                                              column=default:c0, timestamp=1408396641845, value=c0_value_3
 12345                                              column=default:c1, timestamp=1408396641845, value=c1_value_3
 12345                                              column=default:c2, timestamp=1408396641845, value=c2_value_3
 12345                                              column=default:c3, timestamp=1408396641845, value=c3_value_3
 12345                                              column=default:c4, timestamp=1408396641845, value=c4_value_3
1 row(s) in 0.3580 seconds

Thanks,
Cristian Armaselu
Solution Architect
Shared Technology Services

6021 Connection Drive
Irving, TX 75039
carmaselu@epsilon.com<ma...@epsilon.com>
[Epsilon_logo_PMS_wTag_horiz]
The information contained in this communication is confidential, and is intended only for the sole use of the recipient named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please re-send this communication to the sender and delete the original message or any copy of it from your computer system. Thank you.


________________________________

This e-mail and files transmitted with it are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you are not one of the named recipient(s) or otherwise have reason to believe that you received this message in error, please immediately notify sender by e-mail, and destroy the original message. Thank You.