Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ECD2A117C3 for ; Thu, 21 Aug 2014 20:15:12 +0000 (UTC) Received: (qmail 75512 invoked by uid 500); 21 Aug 2014 20:15:12 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 75473 invoked by uid 500); 21 Aug 2014 20:15:12 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 75460 invoked by uid 99); 21 Aug 2014 20:15:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Aug 2014 20:15:12 +0000 Date: Thu, 21 Aug 2014 20:15:12 +0000 (UTC) From: "Andrew Purtell (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-11788) hbase is not deleting the cell when a Put with a KeyValue, KeyValue.Type.Delete is submitted MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-11788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14105878#comment-14105878 ] Andrew Purtell commented on HBASE-11788: ---------------------------------------- bq. I cannot point in Hive where the issue is. I see the behavior in the queries executed against it. Yes, that was my misunderstanding. I just saw in the related conversation on dev@ an indication it's your code using the HBase API directly that is bundling deletes with puts. bq. (since 2 JVM, 2 threads of execution) Assemble a Put and a Delete into a [RowMutations|https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/RowMutations.html] and each Put+Delete bundle (the RowMutations) from each JVM will operate atomically with respect to the other. > hbase is not deleting the cell when a Put with a KeyValue, KeyValue.Type.Delete is submitted > -------------------------------------------------------------------------------------------- > > Key: HBASE-11788 > URL: https://issues.apache.org/jira/browse/HBASE-11788 > Project: HBase > Issue Type: Bug > Affects Versions: 0.99.0, 0.96.1.1, 0.98.5, 2.0.0 > Environment: Cloudera CDH 5.1.x > Reporter: Cristian Armaselu > Attachments: TestPutWithDelete.java > > > Code executed: > {code} > @Test > public void testHbasePutDeleteCell() throws Exception { > TableName tableName = TableName.valueOf("my_test"); > Configuration configuration = HBaseConfiguration.create(); > HTableInterface table = new HTable(configuration, tableName); > final String rowKey = "12345"; > final byte[] familly = Bytes.toBytes("default"); > // put one row > Put put = new Put(Bytes.toBytes(rowKey)); > put.add(familly, Bytes.toBytes("A"), Bytes.toBytes("a")); > put.add(familly, Bytes.toBytes("B"), Bytes.toBytes("b")); > put.add(familly, Bytes.toBytes("C"), Bytes.toBytes("c")); > table.put(put); > // get row back and assert the values > Get get = new Get(Bytes.toBytes(rowKey)); > Result result = table.get(get); > Assert.isTrue(Bytes.toString(result.getValue(familly, Bytes.toBytes("A"))).equals("a"), "Column A value should be a"); > Assert.isTrue(Bytes.toString(result.getValue(familly, Bytes.toBytes("B"))).equals("b"), "Column B value should be b"); > Assert.isTrue(Bytes.toString(result.getValue(familly, Bytes.toBytes("C"))).equals("c"), "Column C value should be c"); > // put the same row again with C column deleted > put = new Put(Bytes.toBytes(rowKey)); > put.add(familly, Bytes.toBytes("A"), Bytes.toBytes("a")); > put.add(familly, Bytes.toBytes("B"), Bytes.toBytes("b")); > put.add(new KeyValue(Bytes.toBytes(rowKey), familly, Bytes.toBytes("C"), HConstants.LATEST_TIMESTAMP, KeyValue.Type.DeleteColumn)); > table.put(put); > // get row back and assert the values > get = new Get(Bytes.toBytes(rowKey)); > result = table.get(get); > Assert.isTrue(Bytes.toString(result.getValue(familly, Bytes.toBytes("A"))).equals("a"), "Column A value should be a"); > Assert.isTrue(Bytes.toString(result.getValue(familly, Bytes.toBytes("B"))).equals("b"), "Column A value should be b"); > Assert.isTrue(result.getValue(familly, Bytes.toBytes("C")) == null, "Column C should not exists"); > } > {code} > This assertion fails, the cell is not deleted but rather the value is empty: > {code} > hbase(main):029:0> scan 'my_test' > ROW COLUMN+CELL > 12345 column=default:A, timestamp=1408473082290, value=a > 12345 column=default:B, timestamp=1408473082290, value=b > 12345 column=default:C, timestamp=1408473082290, value= > {code} > This behavior is different than previous 4.8.x Cloudera version and is currently corrupting all hive queries involving is null or is not null operators on the columns mapped to hbase -- This message was sent by Atlassian JIRA (v6.2#6252)