Hello Community,

According to the HBASE-5980[1], rowsFiltered should only count the number of 
rows filtered by the filter.
However, if the current row is DeleteFamily, the number of rowsFiltered 
increases because there are no results in populateResult.

------------

// HRegion.RegionScannerImpl#nextInternal
private boolean nextInternal(List<Cell> results, ScannerContext scannerContext) 
throws IOException {
  // current=..../DeleteFamily/vlen=?/seqid=?
  Cell current = this.storeHeap.peek();

  // hasFilterRow = false
  boolean hasFilterRow = this.filter != null && this.filter.hasFilterRow();

  if (joinedContinuationRow == null) {
    // results is empty.
    populateResult(results, this.storeHeap, scannerContext, current);

    Cell nextKv = this.storeHeap.peek();
    shouldStop = shouldStop(nextKv);
    // isEmptyRow = true
    final boolean isEmptyRow = results.isEmpty();

    if (isEmptyRow || ret == FilterWrapper.FilterRowRetCode.EXCLUDE || 
filterRow()) {
      // rowsFiltered++ (Because isEmptyRow=true)
      incrementCountOfRowsFilteredMetric(scannerContext);
    }
  }
}

------------

I tried to use rowsFiltered to check the number of rows filtered by the filter, 
but it seems that there is no way to check it currently.
I wonder if this behavior is intentional.

Thanks.

[1]: https://issues.apache.org/jira/browse/HBASE-5980

Reply via email to