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

    https://github.com/apache/incubator-quickstep/pull/229#discussion_r110303831
  
    --- Diff: query_optimizer/resolver/Resolver.cpp ---
    @@ -1350,16 +1351,172 @@ L::LogicalPtr Resolver::resolveSelect(
       return logical_plan;
     }
     
    +L::LogicalPtr Resolver::resolveSetOperations(
    +    const ParseSetOperation &parse_set_operations,
    +    const std::string &set_operation_name,
    +    const std::vector<const Type*> *type_hints,
    +    const NameResolver *parent_resolver) {
    +  std::vector<const ParseSetOperation*> operands;
    +  CollapseSetOperation(parse_set_operations, parse_set_operations, 
&operands);
    +
    +  DCHECK_LT(1u, operands.size());
    +  std::vector<L::LogicalPtr> resolved_operations;
    +  std::vector<std::vector<E::AttributeReferencePtr>> attribute_matrix;
    +
    +  // Resolve the first operation, and get the output attributes.
    +  auto iter = operands.begin();
    +  const ParseSetOperation &operation = static_cast<const 
ParseSetOperation&>(**iter);
    +  L::LogicalPtr operation_logical =
    +      resolveSetOperationDispatcher(operation, set_operation_name, 
type_hints, parent_resolver);
    +  const std::vector<E::AttributeReferencePtr> operation_attributes =
    +      operation_logical->getOutputAttributes();
    +  attribute_matrix.push_back(operation_attributes);
    +  resolved_operations.push_back(operation_logical);
    +
    +  // Resolve the rest operations, and check the size of output attributes.
    +  ++iter;
    +  for (; iter != operands.end(); ++iter) {
    --- End diff --
    
    We could merge `++iter;` in Line 1377 inside the for-loop.


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