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 B2D5EEE22 for ; Tue, 22 Jan 2013 17:28:15 +0000 (UTC) Received: (qmail 49828 invoked by uid 500); 22 Jan 2013 17:28:13 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 49777 invoked by uid 500); 22 Jan 2013 17:28:13 -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 49721 invoked by uid 99); 22 Jan 2013 17:28:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jan 2013 17:28:13 +0000 Date: Tue, 22 Jan 2013 17:28:13 +0000 (UTC) From: "Guido Serra aka Zeph (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-7645) put without timestamp duplicates the record/row 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-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559783#comment-13559783 ] Guido Serra aka Zeph commented on HBASE-7645: --------------------------------------------- [~anoopsamjohn] uh, ok... so that is then expect. Thanks for clarifying :) I'll handle it on client side then > put without timestamp duplicates the record/row > ----------------------------------------------- > > Key: HBASE-7645 > URL: https://issues.apache.org/jira/browse/HBASE-7645 > Project: HBase > Issue Type: Brainstorming > Components: Client > Reporter: Guido Serra aka Zeph > Priority: Trivial > > if I call a couple of times SQOOP on the same dataset, outputting to HBase, > I will end up with duplicated data... > {code} > hbase(main):030:0> get "dump_HKFAS.sales_order", "1", {COLUMN => "mysql:created_at", VERSIONS => 4} > COLUMN CELL > mysql:created_at timestamp=1358853505756, value=2011-12-21 18:07:38.0 > mysql:created_at timestamp=1358790515451, value=2011-12-21 18:07:38.0 > 2 row(s) in 0.0040 seconds > today's sqoop run > hbase(main):031:0> Date.new(1358853505756).toString() > => "Tue Jan 22 11:18:25 UTC 2013" > yesterday's sqoop run > hbase(main):032:0> Date.new(1358790515451).toString() > => "Mon Jan 21 17:48:35 UTC 2013" > {code} > the fact that the Put.add() method writes the kv without checking if, apart of the timestamp, the value has not changed, is it by design? or a bug? > I mean, what's the idea behind? Shall it be SQOOP (the client application) supposed to handle the read on the value before issuing an add() statement call? > from: trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Put.java > {code} > public Put add(byte [] family, byte [] qualifier, byte [] value) { > return add(family, qualifier, this.ts, value); > } > public Put add(byte [] family, byte [] qualifier, long ts, byte [] value) { > List list = getKeyValueList(family); > KeyValue kv = createPutKeyValue(family, qualifier, ts, value); > list.add(kv); > familyMap.put(kv.getFamily(), list); > return this; > } > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira