hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-4295) rowcounter does not return the correct number of rows in certain circumstances
Date Fri, 23 Sep 2011 23:11:28 GMT

    [ https://issues.apache.org/jira/browse/HBASE-4295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13113824#comment-13113824
] 

Hudson commented on HBASE-4295:
-------------------------------

Integrated in HBase-0.92 #17 (See [https://builds.apache.org/job/HBase-0.92/17/])
    HBASE-4295 rowcounter does not return the correct number of rows in certain circumstances

stack : 
Files : 
* /hbase/branches/0.92/CHANGES.txt
* /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/mapred/RowCounter.java
* /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java


> 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
>            Assignee: Dave Revell
>             Fix For: 0.90.5
>
>         Attachments: HBASE-4295-v1.patch
>
>
> When you run
> {noformat}
> hadoop jar hbase.jar rowcounter <table>
> {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

        

Mime
View raw message