quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zu...@apache.org
Subject [34/50] [abbrv] incubator-quickstep git commit: AddWorkOrdersUsingPartitionedInput added.
Date Fri, 27 May 2016 03:23:25 GMT
AddWorkOrdersUsingPartitionedInput added.


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

Branch: refs/heads/partition_aware_hashjoin_with_optimizer_support
Commit: 303e3a18158167065c17d9a352d8a181360ad050
Parents: 1f7218a
Author: Adalbert Gerald Soosai Raj <gerald@cs.wisc.edu>
Authored: Mon May 23 18:03:17 2016 -0500
Committer: Adalbert Gerald Soosai Raj <gerald@cs.wisc.edu>
Committed: Mon May 23 18:03:17 2016 -0500

----------------------------------------------------------------------
 relational_operators/HashJoinOperator.cpp | 60 +++++++++++++++++++++++++-
 relational_operators/HashJoinOperator.hpp |  8 ++++
 2 files changed, 66 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/303e3a18/relational_operators/HashJoinOperator.cpp
----------------------------------------------------------------------
diff --git a/relational_operators/HashJoinOperator.cpp b/relational_operators/HashJoinOperator.cpp
index 28dfa3a..4acabde 100644
--- a/relational_operators/HashJoinOperator.cpp
+++ b/relational_operators/HashJoinOperator.cpp
@@ -286,6 +286,52 @@ void HashJoinOperator::addWorkOrders(WorkOrdersContainer *container,
     }  // end else (probe_relation_is_stored_)
 }
 
+template <class JoinWorkOrderClass>
+void HashJoinOperator::addWorkOrdersUsingPartitionedInput(WorkOrdersContainer *container,
+                                                          QueryContext *query_context,
+                                                          StorageManager *storage_manager,
+                                                          const Predicate *residual_predicate,
+                                                          const std::vector<std::unique_ptr<const
Scalar>> &selection,
+                                                          InsertDestination *output_destination)
{
+  const JoinHashTable &hash_table = *(query_context->getJoinHashTable(hash_table_group_index_));
+  const std::size_t num_partitions =
+      probe_relation_.getPartitionScheme().getPartitionSchemeHeader().getNumPartitions();
+  if (probe_relation_is_stored_) {
+    for (std::size_t part_id = 0; part_id < num_partitions; ++part_id) {
+      for (const block_id probe_block_id : probe_relation_block_ids_in_partition_[part_id])
{
+        container->addNormalWorkOrder(new JoinWorkOrderClass(build_relation_,
+                                                             probe_relation_,
+                                                             join_key_attributes_,
+                                                             any_join_key_attributes_nullable_,
+                                                             probe_block_id,
+                                                             residual_predicate,
+                                                             selection,
+                                                             hash_table,
+                                                             output_destination,
+                                                             storage_manager),
+                                      op_index_);
+      }
+    }
+  } else {
+    for (std::size_t part_id = 0; part_id < num_partitions; ++part_id) {
+      while (num_workorders_generated_ < probe_relation_block_ids_in_partition_[part_id].size())
{
+        container->addNormalWorkOrder(new JoinWorkOrderClass(build_relation_,
+                                                             probe_relation_,
+                                                             join_key_attributes_,
+                                                             any_join_key_attributes_nullable_,
+                                                             probe_relation_block_ids_[num_workorders_generated_],
+                                                             residual_predicate,
+                                                             selection,
+                                                             hash_table,
+                                                             output_destination,
+                                                             storage_manager),
+                                      op_index_);
+        ++num_workorders_generated_;
+      }  // end while
+    }
+  }  // end else (probe_relation_is_stored_)
+}
+
 #ifdef QUICKSTEP_HAVE_LIBNUMA
 template <class JoinWorkOrderClass>
 void HashJoinOperator::addPartitionAwareWorkOrders(WorkOrdersContainer *container,
@@ -384,11 +430,16 @@ bool HashJoinOperator::getAllNonOuterJoinWorkOrders(WorkOrdersContainer
*contain
 
     if (probe_relation_is_stored_) {
       if (!started_) {
-        if (probe_relation_.hasPartitionScheme() && probe_relation_.hasNUMAPlacementScheme()
&& is_numa_aware_join_) {
+        if (probe_relation_.hasPartitionScheme() && probe_relation_.hasNUMAPlacementScheme())
{
+          if (is_numa_aware_join_) {
 #ifdef QUICKSTEP_HAVE_LIBNUMA
           addPartitionAwareWorkOrders<JoinWorkOrderClass>(
               container, query_context, storage_manager, residual_predicate, selection, output_destination);
 #endif
+          } else {
+            addWorkOrdersUsingPartitionedInput<JoinWorkOrderClass>(
+                container, query_context, storage_manager, residual_predicate, selection,
output_destination);
+          }
         } else {
           addWorkOrders<JoinWorkOrderClass>(
               container, query_context, storage_manager, residual_predicate, selection, output_destination);
@@ -397,11 +448,16 @@ bool HashJoinOperator::getAllNonOuterJoinWorkOrders(WorkOrdersContainer
*contain
       }
       return started_;
     } else {
-      if (probe_relation_.hasPartitionScheme() && probe_relation_.hasNUMAPlacementScheme()
&& is_numa_aware_join_) {
+      if (probe_relation_.hasPartitionScheme() && probe_relation_.hasNUMAPlacementScheme())
{
+        if (is_numa_aware_join_) {
 #ifdef QUICKSTEP_HAVE_LIBNUMA
         addPartitionAwareWorkOrders<JoinWorkOrderClass>(
             container, query_context, storage_manager, residual_predicate, selection, output_destination);
 #endif
+        } else {
+          addWorkOrdersUsingPartitionedInput<JoinWorkOrderClass>(
+              container, query_context, storage_manager, residual_predicate, selection, output_destination);
+        }
       } else {
         addWorkOrders<JoinWorkOrderClass>(
             container, query_context, storage_manager, residual_predicate, selection, output_destination);

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/303e3a18/relational_operators/HashJoinOperator.hpp
----------------------------------------------------------------------
diff --git a/relational_operators/HashJoinOperator.hpp b/relational_operators/HashJoinOperator.hpp
index 340e561..3e50eef 100644
--- a/relational_operators/HashJoinOperator.hpp
+++ b/relational_operators/HashJoinOperator.hpp
@@ -235,6 +235,14 @@ class HashJoinOperator : public RelationalOperator {
                      const std::vector<std::unique_ptr<const Scalar>> &selection,
                      InsertDestination *output_destination);
 
+  template <class JoinWorkOrderClass>
+  void addWorkOrdersUsingPartitionedInput(WorkOrdersContainer *container,
+                                          QueryContext *query_context,
+                                          StorageManager *storage_manager,
+                                          const Predicate *predicate,
+                                          const std::vector<std::unique_ptr<const Scalar>>
&selection,
+                                          InsertDestination *output_destination);
+
 #ifdef QUICKSTEP_HAVE_LIBNUMA
   template <class JoinWorkOrderClass>
   void addPartitionAwareWorkOrders(WorkOrdersContainer *container,


Mime
View raw message