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

    https://github.com/apache/incubator-quickstep/pull/234#discussion_r112333371
  
    --- Diff: relational_operators/UnionAllOperator.cpp ---
    @@ -128,14 +128,56 @@ bool UnionAllOperator::getAllWorkOrders(
     }
     
     bool UnionAllOperator::getAllWorkOrderProtos(WorkOrderProtosContainer* 
container) {
    -  // TODO(tianrun): Add protobuf for UnionAllWorkOrder to support 
distributed mode.
    -  LOG(FATAL) << "UnionAllOperator is not supported in distributed mode 
yet.";
    -  return true;
    +  if (!stored_generated_) {
    +    for (std::size_t relation_index = 0; relation_index < 
input_relations_.size(); ++relation_index) {
    +      if (input_relations_are_stored_[relation_index]) {
    +        const std::vector<block_id> &all_blocks = 
input_relations_block_ids_[relation_index];
    +        const relation_id relation = 
input_relations_[relation_index]->getID();
    +        const std::vector<attribute_id> &attributes = 
select_attribute_ids_[relation_index];
    +        for (const block_id block : all_blocks) {
    +          container->addWorkOrderProto(createWorkOrderProto(block, 
relation, attributes), op_index_);
    +        }
    +      }
    +    }
    +    stored_generated_ = true;
    +  }
    +
    +  for (std::size_t relation_index = 0; relation_index < 
input_relations_.size(); ++relation_index) {
    +    if (!input_relations_are_stored_[relation_index]) {
    +      const std::vector<block_id> &all_blocks = 
input_relations_block_ids_[relation_index];
    +      std::size_t num_generated = 
num_workorders_generated_[relation_index];
    +      const relation_id relation = 
input_relations_[relation_index]->getID();
    +      const std::vector<attribute_id> &attributes = 
select_attribute_ids_[relation_index];
    +      while (num_generated < all_blocks.size()) {
    +        
container->addWorkOrderProto(createWorkOrderProto(all_blocks[num_generated], 
relation, attributes), op_index_);
    +        ++num_generated;
    +      }
    +      num_workorders_generated_[relation_index] = num_generated;
    +    }
    +  }
    +  return stored_generated_ && done_feeding_input_relation_;
    --- End diff --
    
    Is `stored_generated_ && ...` redundant, as it will always be true here? 


---
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