quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shix...@apache.org
Subject incubator-quickstep git commit: Minor comment changes
Date Wed, 27 Jul 2016 14:48:51 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/SQL-window-aggregation 0a23f1719 -> 130afbe27


Minor comment changes


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/130afbe2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/130afbe2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/130afbe2

Branch: refs/heads/SQL-window-aggregation
Commit: 130afbe27467f02c67613e56522ae7b4272236c1
Parents: 0a23f17
Author: shixuan <shixuan@apache.org>
Authored: Wed Jul 27 09:48:21 2016 -0500
Committer: shixuan <shixuan@apache.org>
Committed: Wed Jul 27 09:48:21 2016 -0500

----------------------------------------------------------------------
 .../window_aggregation/WindowAggregateFunction.hpp     |  9 ++++-----
 .../window_aggregation/WindowAggregationHandle.cpp     |  3 ++-
 .../window_aggregation/WindowAggregationHandle.hpp     | 13 ++++++-------
 .../window_aggregation/WindowAggregationHandleAvg.cpp  |  1 -
 .../window_aggregation/WindowAggregationHandleAvg.hpp  |  5 ++---
 .../tests/WindowAggregationHandleAvg_unittest.cpp      |  1 -
 6 files changed, 14 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/130afbe2/expressions/window_aggregation/WindowAggregateFunction.hpp
----------------------------------------------------------------------
diff --git a/expressions/window_aggregation/WindowAggregateFunction.hpp b/expressions/window_aggregation/WindowAggregateFunction.hpp
index f08974a..7ffc4ae 100644
--- a/expressions/window_aggregation/WindowAggregateFunction.hpp
+++ b/expressions/window_aggregation/WindowAggregateFunction.hpp
@@ -122,16 +122,15 @@ class WindowAggregateFunction {
    *
    * @param argument_types A list of zero or more Types (in order) for
    *        arguments to this WindowAggregateFunction.
-   * @param partition_key_types The Types of the partition key.
-   * @param first_order_key_type The type of the first order key, nullptr if
-   *                             not needed.
+   * @param partition_by_attributes A list of attributes used as partition key.
+   * @param order_by_attributes A list of attributes used as order key.
    * @param is_row True if the frame mode is ROWS, false if RANGE.
    * @param num_preceding The number of rows/range that precedes the current row.
    * @param num_following The number of rows/range that follows the current row.
    * 
    * @return A new WindowAggregationHandle that can be used to compute this
-   *         WindowAggregateFunction over the specified argument_types. Caller
-   *         is responsible for deleting the returned object.
+   *         WindowAggregateFunction over the specified window definition.
+   *         Caller is responsible for deleting the returned object.
    **/
   virtual WindowAggregationHandle* createHandle(
       const std::vector<const Type*> &argument_types,

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/130afbe2/expressions/window_aggregation/WindowAggregationHandle.cpp
----------------------------------------------------------------------
diff --git a/expressions/window_aggregation/WindowAggregationHandle.cpp b/expressions/window_aggregation/WindowAggregationHandle.cpp
index e0062da..835eaff 100644
--- a/expressions/window_aggregation/WindowAggregationHandle.cpp
+++ b/expressions/window_aggregation/WindowAggregationHandle.cpp
@@ -157,7 +157,8 @@ bool WindowAggregationHandle::inWindow(
     }
 
     // Get the boundary value if it is not UNBOUNDED.
-    if (num_preceding_ > -1) {  // num_preceding is negated.
+    if (num_preceding_ > -1) {
+      // num_preceding needs to be negated for calculation.
       std::int64_t neg_num_preceding = -num_preceding_;
       TypedValue start_boundary_value =
           range_add_operator_->applyToTypedValues(

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/130afbe2/expressions/window_aggregation/WindowAggregationHandle.hpp
----------------------------------------------------------------------
diff --git a/expressions/window_aggregation/WindowAggregationHandle.hpp b/expressions/window_aggregation/WindowAggregationHandle.hpp
index b43d8a1..41d1d96 100644
--- a/expressions/window_aggregation/WindowAggregationHandle.hpp
+++ b/expressions/window_aggregation/WindowAggregationHandle.hpp
@@ -62,7 +62,7 @@ class ValueAccessor;
  * provides methods that are used to actually compute the window aggregate.
  *
  * The work flow for computing a window aggregate is:
- *     2. One thread will handle all the computation, iterating from the first
+ *     1. One thread will handle all the computation, iterating from the first
  *        tuple to the last tuple. Note there will be two modes that could be
  *        used upon different situations:
  *        a. If the window aggregate is defined as accumulative, which are:
@@ -81,7 +81,7 @@ class ValueAccessor;
  *           we could know which values should be dropped as the window slides.
  *        For each computed value, generate a TypedValue and store it into a
  *        ColumnVector for window aggregate values.
- *     3. Return the result ColumnVector.
+ *     2. Return the result ColumnVector.
  *
  * TODO(Shixuan): Currently we don't support parallelization. The basic idea for
  * parallelization is to calculate the partial result inside each block. Each
@@ -112,9 +112,8 @@ class WindowAggregationHandle {
   /**
    * @brief Constructor.
    *
-   * @param partition_key_types The Types of the partition key.
-   * @param first_order_key_type The type of the first order key, nullptr if
-   *                             not needed.
+   * @param partition_by_attributes A list of attributes used as partition key.
+   * @param order_by_attributes A list of attributes used as order key.
    * @param is_row True if the frame mode is ROWS, false if RANGE.
    * @param num_preceding The number of rows/range that precedes the current row.
    * @param num_following The number of rows/range that follows the current row.
@@ -150,11 +149,11 @@ class WindowAggregationHandle {
   bool inWindow(const ColumnVectorsValueAccessor *tuple_accessor,
                 const tuple_id test_tuple_id) const;
 
-  // Ids and comparators for partition keys.
+  // IDs and comparators for partition keys.
   std::vector<attribute_id> partition_key_ids_;
   std::vector<std::unique_ptr<UncheckedComparator>> partition_equal_comparators_;
 
-  // Id, type, Comparator and operator for frame boundary check in RANGE mode.
+  // IDs, type, Comparator and operator for frame boundary check in RANGE mode.
   std::vector<attribute_id> order_key_ids_;
   std::unique_ptr<UncheckedBinaryOperator> range_add_operator_;
   std::unique_ptr<UncheckedComparator> range_comparator_;  // Less than or Equal

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/130afbe2/expressions/window_aggregation/WindowAggregationHandleAvg.cpp
----------------------------------------------------------------------
diff --git a/expressions/window_aggregation/WindowAggregationHandleAvg.cpp b/expressions/window_aggregation/WindowAggregationHandleAvg.cpp
index dae1f33..e6a4b3f 100644
--- a/expressions/window_aggregation/WindowAggregationHandleAvg.cpp
+++ b/expressions/window_aggregation/WindowAggregationHandleAvg.cpp
@@ -106,7 +106,6 @@ ColumnVector* WindowAggregationHandleAvg::calculate(
   // Initialize the output column and argument accessor.
   NativeColumnVector *window_aggregates =
       new NativeColumnVector(*result_type_, tuple_accessor->getNumTuples());
-
   ColumnVectorsValueAccessor *argument_accessor = new ColumnVectorsValueAccessor();
   argument_accessor->addColumn(arguments[0]);
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/130afbe2/expressions/window_aggregation/WindowAggregationHandleAvg.hpp
----------------------------------------------------------------------
diff --git a/expressions/window_aggregation/WindowAggregationHandleAvg.hpp b/expressions/window_aggregation/WindowAggregationHandleAvg.hpp
index b709cf4..f7f2e4d 100644
--- a/expressions/window_aggregation/WindowAggregationHandleAvg.hpp
+++ b/expressions/window_aggregation/WindowAggregationHandleAvg.hpp
@@ -61,9 +61,8 @@ class WindowAggregationHandleAvg : public WindowAggregationHandle {
   /**
    * @brief Constructor.
    *
-   * @param partition_key_types The Types of the partition key.
-   * @param first_order_key_type The type of the first order key, nullptr if
-   *                             not needed.
+   * @param partition_by_attributes A list of attributes used as partition key.
+   * @param order_by_attributes A list of attributes used as order key.
    * @param is_row True if the frame mode is ROWS, false if RANGE.
    * @param num_preceding The number of rows/range that precedes the current row.
    * @param num_following The number of rows/range that follows the current row.

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/130afbe2/expressions/window_aggregation/tests/WindowAggregationHandleAvg_unittest.cpp
----------------------------------------------------------------------
diff --git a/expressions/window_aggregation/tests/WindowAggregationHandleAvg_unittest.cpp
b/expressions/window_aggregation/tests/WindowAggregationHandleAvg_unittest.cpp
index d2cbbd8..cb58083 100644
--- a/expressions/window_aggregation/tests/WindowAggregationHandleAvg_unittest.cpp
+++ b/expressions/window_aggregation/tests/WindowAggregationHandleAvg_unittest.cpp
@@ -121,7 +121,6 @@ class WindowAggregationHandleAvgTest : public::testing::Test {
 
     EXPECT_EQ(expected.size(), native->size());
     for (std::size_t i = 0; i < expected.size(); ++i) {
-      std::cout << i << '\n';
       if (expected[i] == nullptr) {
         EXPECT_TRUE(native->getTypedValue(i).isNull());
       } else {


Mime
View raw message