Github user zuyu commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/165#discussion_r97168597
  
    --- Diff: relational_operators/HashJoinOperator.cpp ---
    @@ -207,49 +207,43 @@ bool HashJoinOperator::getAllNonOuterJoinWorkOrders(
             query_context->getScalarGroup(selection_index_);
         InsertDestination *output_destination =
             query_context->getInsertDestination(output_destination_index_);
    -    const JoinHashTable &hash_table =
    -        *(query_context->getJoinHashTable(hash_table_index_));
     
         if (probe_relation_is_stored_) {
    -      if (!started_) {
    -        for (const block_id probe_block_id : probe_relation_block_ids_) {
    +      if (started_) {
    +        return true;
    +      }
    +
    +      for (std::size_t part_id = 0; part_id < num_partitions_; ++part_id) {
    +        const JoinHashTable &hash_table =
    +            *(query_context->getJoinHashTable(hash_table_index_, part_id));
    +
    +        for (const block_id probe_block_id : 
probe_relation_block_ids_[part_id]) {
               container->addNormalWorkOrder(
    -              new JoinWorkOrderClass(query_id_,
    -                                     build_relation_,
    -                                     probe_relation_,
    -                                     join_key_attributes_,
    -                                     any_join_key_attributes_nullable_,
    -                                     probe_block_id,
    -                                     residual_predicate,
    -                                     selection,
    -                                     hash_table,
    -                                     output_destination,
    -                                     storage_manager,
    +              new JoinWorkOrderClass(query_id_, build_relation_, 
probe_relation_, join_key_attributes_,
    +                                     any_join_key_attributes_nullable_, 
num_partitions_, part_id, probe_block_id,
    +                                     residual_predicate, selection, 
hash_table, output_destination, storage_manager,
                                          
CreateLIPFilterAdaptiveProberHelper(lip_deployment_index_, query_context)),
                   op_index_);
             }
    -        started_ = true;
           }
    -      return started_;
    +      started_ = true;
    +      return true;
         } else {
    -      while (num_workorders_generated_ < probe_relation_block_ids_.size()) 
{
    -        container->addNormalWorkOrder(
    -            new JoinWorkOrderClass(
    -                query_id_,
    -                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,
    -                CreateLIPFilterAdaptiveProberHelper(lip_deployment_index_, 
query_context)),
    -            op_index_);
    -        ++num_workorders_generated_;
    -      }  // end while
    +      for (std::size_t part_id = 0; part_id < num_partitions_; ++part_id) {
    --- End diff --
    
    It depends on the input relation and the optimizer. The former may have 
given partitions (i.e., 4), and the latter may add an explicit partition phase 
for a relation w/o partitions.
    
    I do so to minimize the code changes without hurting the performance much.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to