You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Andrew Kyle Purtell (Jira)" <ji...@apache.org> on 2022/06/16 17:58:00 UTC

[jira] [Resolved] (HBASE-9331) FuzzyRow filter getNextForFuzzyRule not working properly for special case

     [ https://issues.apache.org/jira/browse/HBASE-9331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Kyle Purtell resolved HBASE-9331.
----------------------------------------
    Resolution: Abandoned

> FuzzyRow filter getNextForFuzzyRule not working properly for special case
> -------------------------------------------------------------------------
>
>                 Key: HBASE-9331
>                 URL: https://issues.apache.org/jira/browse/HBASE-9331
>             Project: HBase
>          Issue Type: Bug
>          Components: Filters
>    Affects Versions: 0.94.11
>         Environment: Issue is not dependent upon environment.
>            Reporter: Tony Dean
>            Priority: Major
>         Attachments: TestFuzzyRowFilter.patch
>
>
> The case that getNextForFuzzyRule() fails is when the result (fuzzy key) is extended in length (zero padded) to match the current row for comparisons.  If the hint is returned with zero padded bytes, the next seek may skip over a valid match.  See the example below.
>     /**
>      * The code below circumvents the following situation.
>      * 
>      * fuzzy.key  = visitor,session,Logon
>      * fuzzy.mask = 000000001111111000000
>      * 
>      * example hbase row data:
>      * visitor,session,AddToCart
>      *    "       "    FacebookLike
>      *    "       "    Logon
>      *    "       "    MobileSpecial
>      *    ...
>      *    
>      * 
>      * For row "visitor,sessionAddToCart", the current code would
>      * return a hint of "visitor,session,Logon\0\0\0\0" (zero padded).
>      * The next seek would skip "visitor,session,Logon" and jump
>      * to "visitor,session,MobileSpecial".
>      */
>     
>     // trim trailing zeros that were not part of the original fuzzy key
>     int i = result.length;
>     for (; i > fuzzyKeyBytes.length; i--)
>     {
>     	if (result[i-1] != 0x00)
>     		break;
>     }
>     if (i != result.length)
>     {
>     	result = Arrays.copyOf(result, i);
>     }
> The code above added to the end of getNextFuzzyRule() will circumvent the issue.  I tested my scenario and it produces the correct results.  There may be a better solution.
> Thanks.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)