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/03/06 20:18:15 UTC

[18/38] incubator-quickstep git commit: Fix a bug with SelectOperator

Fix a bug with SelectOperator


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

Branch: refs/heads/reorder-partitioned-hash-join
Commit: e896b61d1932d4593cb18033fe4da23a5e238f77
Parents: e41a6aa
Author: jianqiao <ji...@cs.wisc.edu>
Authored: Wed Mar 1 13:16:47 2017 -0600
Committer: jianqiao <ji...@cs.wisc.edu>
Committed: Wed Mar 1 13:16:47 2017 -0600

----------------------------------------------------------------------
 relational_operators/SelectOperator.hpp                       | 7 +++++--
 .../tests/SortRunGenerationOperator_unittest.cpp              | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e896b61d/relational_operators/SelectOperator.hpp
----------------------------------------------------------------------
diff --git a/relational_operators/SelectOperator.hpp b/relational_operators/SelectOperator.hpp
index b9a4d49..df61c06 100644
--- a/relational_operators/SelectOperator.hpp
+++ b/relational_operators/SelectOperator.hpp
@@ -202,9 +202,12 @@ class SelectOperator : public RelationalOperator {
 
   bool getAllWorkOrderProtos(WorkOrderProtosContainer *container) override;
 
-  void feedInputBlock(const block_id input_block_id, const relation_id input_relation_id,
+  void feedInputBlock(const block_id input_block_id,
+                      const relation_id input_relation_id,
                       const partition_id part_id) override {
-    input_relation_block_ids_[part_id].push_back(input_block_id);
+    if (input_relation_id == input_relation_.getID()) {
+      input_relation_block_ids_[part_id].push_back(input_block_id);
+    }
   }
 
   QueryContext::insert_destination_id getInsertDestinationID() const override {

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e896b61d/relational_operators/tests/SortRunGenerationOperator_unittest.cpp
----------------------------------------------------------------------
diff --git a/relational_operators/tests/SortRunGenerationOperator_unittest.cpp b/relational_operators/tests/SortRunGenerationOperator_unittest.cpp
index 99fafa8..acdd422 100644
--- a/relational_operators/tests/SortRunGenerationOperator_unittest.cpp
+++ b/relational_operators/tests/SortRunGenerationOperator_unittest.cpp
@@ -622,7 +622,7 @@ TEST_F(SortRunGenerationOperatorTest, 3Column_NullLast_Asc) {
 
   // Comparator for null-col-1 ASC NULLS LAST, null-col-2 ASC NULLS LAST,
   // null-col-3 ASC NULLS LAST.
-  auto comparator = [this](const Tuple &left, const Tuple &right) -> bool {
+  auto comparator = [](const Tuple &left, const Tuple &right) -> bool {
     TestTupleAttrs l = TupleToTupleAttr(left);
     TestTupleAttrs r = TupleToTupleAttr(right);
     l.c1 = l.null_c4 ? std::numeric_limits<int>::max() : l.c1;