Github user shixuan-fan commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/39#discussion_r68782819
  
    --- 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 --
    
    @zuyu Cpplint keeps reporting the following error when I changed the 
argument to `E::WindowInfo &&window_info_in`:
    
    > ./query_optimizer/resolver/Resolver.cpp:231:  Missing spaces around &&  
[whitespace/operators] [3]
    
    
    Any idea on this?


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