quickstep-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shixuan-fan <...@git.apache.org>
Subject [GitHub] incubator-quickstep pull request #39: QUICKSTEP-20: Resolver support for Win...
Date Fri, 24 Jun 2016 21:19:43 GMT
Github user shixuan-fan commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/39#discussion_r68464557
  
    --- Diff: query_optimizer/resolver/Resolver.cpp ---
    @@ -1684,13 +1857,45 @@ L::LogicalPtr Resolver::resolveJoinedTableReference(
       THROW_SQL_ERROR_AT(&joined_table_reference) << "Full outer join is not supported
yet";
     }
     
    +L::LogicalPtr Resolver::resolveSortInWindow(
    +    const L::LogicalPtr &logical_plan,
    +    const E::WindowInfo &window_info) {
    +  // Sort the table by (p_key, o_key)
    +  std::vector<E::AttributeReferencePtr> sort_attributes(window_info.partition_by_attributes);
    +  sort_attributes.insert(sort_attributes.end(),
    +                         window_info.order_by_attributes.begin(),
    +                         window_info.order_by_attributes.end());
    +
    +  std::vector<bool> sort_directions(
    +      window_info.partition_by_attributes.size(), true);
    +  sort_directions.insert(sort_directions.end(),
    +                         window_info.order_by_directions.begin(),
    +                         window_info.order_by_directions.end());
    +
    +  std::vector<bool> sort_nulls_first(
    +      window_info.partition_by_attributes.size(), false);
    +  sort_nulls_first.insert(sort_nulls_first.end(),
    +                          window_info.nulls_first.begin(),
    +                          window_info.nulls_first.end());
    +
    +  L::LogicalPtr sorted_logical_plan =
    +      L::Sort::Create(logical_plan,
    +                      sort_attributes,
    +                      sort_directions,
    +                      sort_nulls_first,
    --- End diff --
    
    That's totally doable. Let's fix that in another small separate PR to make it more readable.


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