quickstep-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zuyu <...@git.apache.org>
Subject [GitHub] incubator-quickstep pull request #39: QUICKSTEP-20: Resolver support for Win...
Date Tue, 28 Jun 2016 17:34:37 GMT
Github user zuyu commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/39#discussion_r68804311
  
    --- Diff: query_optimizer/resolver/Resolver.cpp ---
    @@ -973,8 +1011,36 @@ L::LogicalPtr Resolver::resolveSelect(
             logical_plan, resolvePredicate(parse_predicate, &expr_resolution_info));
       }
     
    +  // Resolve WINDOW clause.
    +  std::unordered_map<std::string, WindowPlan> sorted_window_map;
    +  if (select_query.window_list() != nullptr) {
    +    if (select_query.window_list()->size() > 1) {
    +      THROW_SQL_ERROR_AT(&(*select_query.window_list()->begin()))
    +        << "Currently we don't support multiple window aggregation functions";
    +    }
    +
    +    // Sort the table according to the window.
    +    for (const ParseWindow &window : *select_query.window_list()) {
    +      // Check for duplicate definition.
    +      // Currently this is useless since we only support one window.
    +      if (sorted_window_map.find(window.name()->value()) != sorted_window_map.end())
{
    +        THROW_SQL_ERROR_AT(window.name())
    +            << "Duplicate definition of window " << window.name()->value();
    +      }
    +
    +      E::WindowInfo resolved_window = resolveWindow(window, *name_resolver);
    +      L::LogicalPtr sorted_logical_plan = resolveSortInWindow(logical_plan,
    +                                                              resolved_window);
    +
    +      WindowPlan window_plan(resolved_window, sorted_logical_plan);
    --- End diff --
    
    `cpplint` sometimes treat the rvalue as a logical `and` expression, so we need to workaround
by adding `// NOLINT(whitespace/operators)`.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message