summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java8
-rw-r--r--src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
index 875eda3..d7f30c8 100644
--- a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
+++ b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
@@ -474,9 +474,13 @@ public class IndexedQueryAnalyzer<S extends Storable> {
* Returns a new result with the remainder filter replaced.
*/
public Result withRemainderFilter(Filter<S> remainderFilter) {
+ Filter<S> handledFilter = getCompositeScore().getFilteringScore().getHandledFilter();
+
+ Filter<S> filter = andFilters(handledFilter, remainderFilter);
+
CompositeScore<S> score = mScore.withRemainderFilter(remainderFilter);
- return new Result(mFilter, score, mLocalIndex,
- mForeignIndex, mForeignProperty, mHints);
+
+ return new Result(filter, score, mLocalIndex, mForeignIndex, mForeignProperty, mHints);
}
/**
diff --git a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
index 6e5262f..17e84ad 100644
--- a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
+++ b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
@@ -426,7 +426,7 @@ public class UnionQueryAnalyzer<S extends Storable> implements QueryExecutorFact
if (mergedResults.size() == 0) {
// Nothing was exempt. Rather than return a result with a dnf
// filter, return full scan with a simpler reduced filter.
- full.withRemainderFilter(filter.reduce());
+ full = full.withRemainderFilter(filter.reduce());
}
mergedResults.add(full);