Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-7337

SingleColumnValueFilter seems to get unavailble data

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 0.94.3, 0.95.2
    • None
    • Filters
    • None
    • 0.94

    Description

      put multi versions of a row.
      r1 cf:q version:1 value:1
      r1 cf:q version:2 value:3
      r1 cf:q version:3 value:2
      the filter in scan is set as below:
      SingleColumnValueFilter valueF = new SingleColumnValueFilter(
      family,qualifier,CompareOp.EQUAL,new BinaryComparator(Bytes
      .toBytes("2")));

      then i found all of the three versions will be emmitted, then i set latestVersionOnly to false, the result does no change.

        public ReturnCode filterKeyValue(KeyValue keyValue) {
          // System.out.println("REMOVE KEY=" + keyValue.toString() + ", value=" + Bytes.toString(keyValue.getValue()));
          if (this.matchedColumn) {
            // We already found and matched the single column, all keys now pass
            return ReturnCode.INCLUDE;
          } else if (this.latestVersionOnly && this.foundColumn) {
            // We found but did not match the single column, skip to next row
            return ReturnCode.NEXT_ROW;
          }
          if (!keyValue.matchingColumn(this.columnFamily, this.columnQualifier)) {
            return ReturnCode.INCLUDE;
          }
          foundColumn = true;
          if (filterColumnValue(keyValue.getBuffer(),
              keyValue.getValueOffset(), keyValue.getValueLength())) {
            return this.latestVersionOnly? ReturnCode.NEXT_ROW: ReturnCode.INCLUDE;
          }
          this.matchedColumn = true;
          return ReturnCode.INCLUDE;
        }
      

      From the code above, it seeems that version 3 will be first emmited, and set matchedColumn to true, which leads the following version 2 and 1 emmited too.

      Attachments

        Activity

          People

            Unassigned Unassigned
            zhou wen jian Zhou wenjian
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: