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

Vladimir Rodionov commented on HBASE-14782:
-------------------------------------------

Here is the code:
{code}
  @Test  
  public void testBug() throws IOException
  {
    String cf = "f";
    String cq = "q";
    

    Table ht =
        TEST_UTIL.createTable(TableName.valueOf(table), Bytes.toBytes(cf), 
Integer.MAX_VALUE);
    // Load data
    String[] rows = new String[]{
        "\\x9C\\x00\\x044\\x00\\x00\\x00\\x00",
        "\\x9C\\x00\\x044\\x01\\x00\\x00\\x00", 
        "\\x9C\\x00\\x044\\x00\\x01\\x00\\x00",
        "\\x9C\\x00\\x044\\x00\\x00\\x01\\x00",
        "\\x9C\\x00\\x044\\x00\\x01\\x00\\x01", 
        "\\x9B\\x00\\x044e\\xBB\\xB2\\xBB", 
    };
    
    String badRow = "\\x9C\\x00\\x03\\xE9e\\xBB{X\\x1Fwts\\x1F\\x15vRX";
    
    for(int i=0; i < rows.length; i++){
      Put p = new Put(Bytes.toBytesBinary(rows[i]));
      p.addColumn(cf.getBytes(), cq.getBytes(), "value".getBytes());
      ht.put(p);            
    }
    
    Put p = new Put(Bytes.toBytesBinary(badRow));
    p.addColumn(cf.getBytes(), cq.getBytes(), "value".getBytes());
    ht.put(p);            

    TEST_UTIL.flush();

    List<Pair<byte[], byte[]>> data =  new ArrayList<Pair<byte[], byte[]>>();
    byte[] fuzzyKey = Bytes.toBytesBinary("\\x00\\x00\\x044");
    byte[] mask = new byte[] { 1,0,0,0};
    data.add(new Pair<byte[], byte[]>(fuzzyKey, mask));
    FuzzyRowFilter filter = new FuzzyRowFilter(data);
    
    Scan scan = new Scan();
    scan.setFilter(filter);
    
    ResultScanner scanner = ht.getScanner(scan);
    Result result = null;
    while((result = scanner.next()) != null){
      LOG.info("?Found "+ Bytes.toStringBinary(result.getRow()));
    }        
  }
{code}

> FuzzyRowFilter skips valid rows
> -------------------------------
>
>                 Key: HBASE-14782
>                 URL: https://issues.apache.org/jira/browse/HBASE-14782
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Vladimir Rodionov
>            Assignee: Vladimir Rodionov
>
> The issue may affect not only master branch, but previous releases as well.
> This is from one of our customers:
> {quote}
> We are experiencing a problem with the FuzzyRowFilter for HBase scan. We 
> think that it is a bug. 
> Fuzzy filter should pick a row if it matches filter criteria irrespective of 
> other rows present in table but filter is dropping a row depending on some 
> other row present in table. 
> Details/Step to reproduce/Sample outputs below: 
> Missing row key: \x9C\x00\x044\x00\x00\x00\x00 
> Causing row key: \x9C\x00\x03\xE9e\xBB{X\x1Fwts\x1F\x15vRX 
> Prerequisites 
> 1. Create a test table. HBase shell command -- create 'fuzzytest','d' 
> 2. Insert some test data. HBase shell commands: 
> • put 'fuzzytest',"\x9C\x00\x044\x00\x00\x00\x00",'d:a','junk' 
> • put 'fuzzytest',"\x9C\x00\x044\x01\x00\x00\x00",'d:a','junk' 
> • put 'fuzzytest',"\x9C\x00\x044\x00\x01\x00\x00",'d:a','junk' 
> • put 'fuzzytest',"\x9C\x00\x044\x00\x00\x01\x00",'d:a','junk' 
> • put 'fuzzytest',"\x9C\x00\x044\x00\x01\x00\x01",'d:a','junk' 
> • put 'fuzzytest',"\x9B\x00\x044e\xBB\xB2\xBB",'d:a','junk' 
> • put 'fuzzytest',"\x9D\x00\x044e\xBB\xB2\xBB",'d:a','junk' 
> Now when you run the code, you will find \x9C\x00\x044\x00\x00\x00\x00 in 
> output because it matches filter criteria. (Refer how to run code below) 
> Insert the row key causing bug: 
> HBase shell command: put 
> 'fuzzytest',"\x9C\x00\x03\xE9e\xBB{X\x1Fwts\x1F\x15vRX",'d:a','junk' 
> Now when you run the code, you will not find \x9C\x00\x044\x00\x00\x00\x00 in 
> output even though it still matches filter criteria. 
> {quote}
> Verified the issue on master.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to