From 8385bdc333478686878a1ae7b6a1590bf0f2621f Mon Sep 17 00:00:00 2001 From: Peter Somogyi Date: Wed, 26 Jul 2017 16:15:01 +0200 Subject: [PATCH] HACK! Revert "HBASE-17678 FilterList with MUST_PASS_ONE lead to redundancy cells returned - addendum" This commit caused an issue upstream which led to a failing pig smoke test. Family filters with OR does not work. HBASE-18410 Ref: CDH-56405 This reverts commit 347bef8d336377ae38bb6c357da9d033ccba155c. --- .../org/apache/hadoop/hbase/filter/FilterList.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 7433cca40f94..985cb16612dc 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -27,7 +27,6 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.CellUtil; -import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; @@ -145,7 +144,7 @@ public FilterList(final Operator operator, final Filter... rowFilters) { public void initPrevListForMustPassOne(int size) { if (operator == Operator.MUST_PASS_ONE) { - if (this.prevFilterRCList == null) { + if (this.prevCellList == null) { prevFilterRCList = new ArrayList<>(Collections.nCopies(size, null)); } if (this.prevCellList == null) { @@ -404,14 +403,7 @@ public ReturnCode filterKeyValue(Cell c) throws IOException { ReturnCode localRC = filter.filterKeyValue(c); // Update previous cell and return code we encountered. prevFilterRCList.set(i, localRC); - if (c == null || localRC == ReturnCode.INCLUDE || localRC == ReturnCode.SKIP) { - // If previous return code is INCLUDE or SKIP, we should always pass the next cell to the - // corresponding sub-filter(need not test shouldPassCurrentCellToFilter() method), So we - // need not save current cell to prevCellList for saving heap memory. - prevCellList.set(i, null); - } else { - prevCellList.set(i, KeyValueUtil.toNewKeyCell(c)); - } + prevCellList.set(i, c); if (localRC != ReturnCode.SEEK_NEXT_USING_HINT) { seenNonHintReturnCode = true;