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

Jie Huang commented on HBASE-6429:
----------------------------------

Checking the 0.94.0 version, it has the similar problem as well. See the 
nextInternal() function in HRegion.java file.
{noformat}
          do {
            this.storeHeap.next(results, limit - results.size(), metric);
            if (limit > 0 && results.size() == limit) {
              if (this.filter != null && filter.hasFilterRow()) { <<< check the 
compatibility between filterRow(kvs) and scan with limit only
                throw new IncompatibleFilterException(
                  "Filter with filterRow(List<KeyValue>) incompatible with scan 
with limit!");
              }
              return true; // we are expecting more yes, but also limited to 
how many we can return.
            }
          } while (Bytes.equals(currentRow, nextRow = peekRow()));
{noformat}

According to current implementation, "hasFilterRow()" function is the only way 
to invoke "filterRow(kvs)", which means that filter has some extra filtering 
work on the entire row. Furthermore, the user has another chance to clear that 
entire row only if "boolean filterRow()" returns true.  The semantics of those 
2 functions , hasFilterRow() and boolean filterRow(),  are quite similar.  From 
my perspective, it would be better to merge two criterion into one.  
  a) We can simply make hasFilterRow() returning true, if either filterRow() or 
filterRow(kvs) has been implemented.  
  b) To do the result.clear() in the filterRow(kvs) function if filterRow() 
returns true.  

It not only fixes this issue, but also somehow eliminates some confusion. If 
someone wants to do something on the entire row (like clear all or parts of the 
row content) in filter, just to return true in hasFilterRow() in their Filter 
implementation. And at them same time,  the cleaning job will be called in the 
filterRow(kvs) function by checking the returned value of  "boolean 
filterRow()", which means all those changings on a row happen in 
filterRow(kvs). 

Any comment? OR I can try to upload one patch later.  
                
> Filter with filterRow() returning true is also incompatible with scan with 
> limit
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-6429
>                 URL: https://issues.apache.org/jira/browse/HBASE-6429
>             Project: HBase
>          Issue Type: Bug
>          Components: filters
>    Affects Versions: 0.96.0
>            Reporter: Jason Dai
>
> Currently if we scan with bot limit and a Filter with 
> filterRow(List<KeyValue>) implemented, an  IncompatibleFilterException will 
> be thrown. The same exception should also be thrown if the filer has its 
> filterRow() implemented.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to