You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "ryan rawson (JIRA)" <ji...@apache.org> on 2009/06/19 01:40:07 UTC

[jira] Commented: (HBASE-1542) Scan returns rows beyond the endRow when the column is specified

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

ryan rawson commented on HBASE-1542:
------------------------------------

Hi, thanks for the detailed report.  The unit test seems to rely on some package local variables not sent along.  In the mean time I wrote what I think is an equivalent test base inside the HRegion test, which does not spin up a cluster (so maybe it's not accurate?).  The test is:

{noformat}

+  public void testScanner_StopRow1542() throws IOException {
+    byte [] tableName = Bytes.toBytes("test_table");
+    byte [] family = Bytes.toBytes("testFamily");
+    initHRegion(tableName, getName(), family);
+
+    byte [] row1 = Bytes.toBytes("row111");
+    byte [] row2 = Bytes.toBytes("row222");
+    byte [] row3 = Bytes.toBytes("row333");
+    byte [] row4 = Bytes.toBytes("row444");
+    byte [] row5 = Bytes.toBytes("row555");
+
+    byte [] col1 = Bytes.toBytes("Pub111");
+    byte [] col2 = Bytes.toBytes("Pub222");
+
+
+
+    Put put = new Put(row1);
+    put.add(family, col1, Bytes.toBytes(10L));
+    region.put(put);
+
+    put = new Put(row2);
+    put.add(family, col1, Bytes.toBytes(15L));
+    region.put(put);
+
+    put = new Put(row3);
+    put.add(family, col2, Bytes.toBytes(20L));
+    region.put(put);
+
+    put = new Put(row4);
+    put.add(family, col2, Bytes.toBytes(30L));
+    region.put(put);
+
+    put = new Put(row5);
+    put.add(family, col1, Bytes.toBytes(40L));
+    region.put(put);
+
+    Scan scan = new Scan(row3, row4);
+    scan.setMaxVersions();
+    scan.addColumn(family, col1);
+    InternalScanner s = region.getScanner(scan);
+
+    List<KeyValue> results = new ArrayList<KeyValue>();
+    assertEquals(true, s.next(results));
+    assertEquals(0, results.size());
+  }
{noformat}

Post HBASE-1541, this test case passes.  

Could you update to latest trunk (at least r786259) and try your test again?  Hopefully it passes now!

Thanks again!

> Scan returns rows beyond the endRow when the column is specified
> ----------------------------------------------------------------
>
>                 Key: HBASE-1542
>                 URL: https://issues.apache.org/jira/browse/HBASE-1542
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.20.0
>         Environment: hbase-0.20.0-dev
> ubuntu 9.04
> jdk 6.0
>            Reporter: Irfan Mohammed
>            Assignee: ryan rawson
>         Attachments: hbase_jira_output.log, HBaseScanBugTest.java
>
>
> We ran into an issue where the scan resulted in rows beyond the endRow. Are we doing something incorrectly here? The test case is given below. When the scan.addColumn(...) is commented, the rows has { "row333" } but having the scan.addColumn(...) in the scan gives rows { "row555" }.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.