You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by zu...@apache.org on 2017/01/11 01:00:59 UTC

[07/50] incubator-quickstep git commit: Allows filters to be evaluated.

Allows filters to be evaluated.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/3093e744
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/3093e744
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/3093e744

Branch: refs/heads/quickstep_partition_parser_support
Commit: 3093e74484b620f828e435f434d674390f81a1c9
Parents: c45d68e
Author: cramja <ma...@gmail.com>
Authored: Tue Nov 8 17:08:22 2016 -0600
Committer: cramja <ma...@gmail.com>
Committed: Wed Nov 9 11:26:20 2016 -0600

----------------------------------------------------------------------
 storage/SMAIndexSubBlock.cpp | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/3093e744/storage/SMAIndexSubBlock.cpp
----------------------------------------------------------------------
diff --git a/storage/SMAIndexSubBlock.cpp b/storage/SMAIndexSubBlock.cpp
index 621bafd..3b3b879 100644
--- a/storage/SMAIndexSubBlock.cpp
+++ b/storage/SMAIndexSubBlock.cpp
@@ -672,25 +672,25 @@ predicate_cost_t SMAIndexSubBlock::estimatePredicateEvaluationCost(
 TupleIdSequence* SMAIndexSubBlock::getMatchesForPredicate(
     const ComparisonPredicate &predicate,
     const TupleIdSequence *filter) const {
-  if (filter != nullptr) {
-    LOG(FATAL) << "SMAIndex cannot evaluate filters.";
-  }
-
   Selectivity selectivity = getSelectivityForPredicate(predicate);
   if (selectivity == Selectivity::kAll) {
-    TupleIdSequence* tidseq = new TupleIdSequence(tuple_store_.numTuples());
-
-    // Set all existing tuples to true, selected.
-    if (tuple_store_.isPacked()) {
-      tidseq->setRange(0, tuple_store_.numTuples(), true);
+    if (filter != nullptr) {
+      return new TupleIdSequence(filter->length(), filter->getInternalBitVector());
     } else {
-      for (tuple_id tid = 0; tid <= tuple_store_.getMaxTupleID(); ++tid) {
-        if (tuple_store_.hasTupleWithID(tid)) {
-          tidseq->set(tid, true);
+      TupleIdSequence* tidseq = new TupleIdSequence(tuple_store_.numTuples());
+
+      // Set all existing tuples to true, selected.
+      if (tuple_store_.isPacked()) {
+        tidseq->setRange(0, tuple_store_.numTuples(), true);
+      } else {
+        for (tuple_id tid = 0; tid <= tuple_store_.getMaxTupleID(); ++tid) {
+          if (tuple_store_.hasTupleWithID(tid)) {
+            tidseq->set(tid, true);
+          }
         }
       }
+      return tidseq;
     }
-    return tidseq;
   } else if (selectivity == Selectivity::kNone) {
     // A new tuple ID sequence is initialized to false for all values.
     return new TupleIdSequence(tuple_store_.numTuples());