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 E884F8648 for ; Tue, 30 Aug 2011 18:58:01 +0000 (UTC) Received: (qmail 36934 invoked by uid 500); 30 Aug 2011 18:58:01 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 36407 invoked by uid 500); 30 Aug 2011 18:58:00 -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 36392 invoked by uid 99); 30 Aug 2011 18:58:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2011 18:58:00 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2011 18:57:58 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 1BB5AD7F16 for ; Tue, 30 Aug 2011 18:57:38 +0000 (UTC) Date: Tue, 30 Aug 2011 18:57:38 +0000 (UTC) From: "Jean-Daniel Cryans (JIRA)" To: issues@hbase.apache.org Message-ID: <2001892429.8809.1314730658110.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1764468723.6114.1314680677701.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HBASE-4295) rowcounter does not return the correct number of rows in certain circumstances 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-4295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13094001#comment-13094001 ] Jean-Daniel Cryans commented on HBASE-4295: ------------------------------------------- I think it's more a problem of "what's a row". If there's one qualifier but it's empty, does the row still exist? I can easily see people not putting values if they don't need to, using the qualifier as a value. Maybe we don't need to check for an empty value. > rowcounter does not return the correct number of rows in certain circumstances > ------------------------------------------------------------------------------ > > Key: HBASE-4295 > URL: https://issues.apache.org/jira/browse/HBASE-4295 > Project: HBase > Issue Type: Bug > Components: mapreduce > Affects Versions: 0.90.4 > Reporter: Wing Yew Poon > > When you run > {noformat} > hadoop jar hbase.jar rowcounter > {noformat} > the org.apache.hadoop.hbase.mapreduce.RowCounter class is run. > The RowCounterMapper class in the RowCounter mapreduce job contains the following: > {noformat} > @Override > public void map(ImmutableBytesWritable row, Result values, > Context context) > throws IOException { > for (KeyValue value: values.list()) { > if (value.getValue().length > 0) { > context.getCounter(Counters.ROWS).increment(1); > break; > } > } > } > {noformat} > The intention is to go through the column values in the row, and increment the ROWS counter if some value is non-empty. However, values.list() always has size 1. This is because the createSubmittableJob static method uses a Scan as follows: > {noformat} > Scan scan = new Scan(); > scan.setFilter(new FirstKeyOnlyFilter()); > {noformat} > So the input map splits always contain just the first KV. If the column corresponding to that first KV is empty, even though other columns are non-empty, that row is skipped. > This way, rowcounter can return an incorrect result. > One way to reproduce this is to create an hbase table with two columns, say f1:q1 and f2:q2. Create some (say 2) rows with empty f1:q1 but non-empty f2:q2, and some (say 3) rows with empty f2:q2 and non-empty f1:q1. > Then run rowcounter (specifying only the table but not any columns). The count will be either 2 short or 3 short. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira