ramitg254 commented on code in PR #6703:
URL: https://github.com/apache/hive/pull/6703#discussion_r3851385920


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFEvaluatorCumeDist.java:
##########
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hadoop.hive.ql.exec.vector.ptf;
+
+import java.util.ArrayDeque;
+import java.util.Deque;
+
+import org.apache.hadoop.hive.ql.exec.vector.ColumnVector.Type;
+import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef;
+
+/**
+ * This class evaluates cume_dist() for a PTF partition.
+ * Unlike rank(), cume_dist needs the total partition row count, group row
+ * count, so it cannot produce a group's
+ * result while the group is still streaming in. It is therefore a peer group
+ * aggregated streaming evaluator
+ * (see {@link VectorPTFEvaluatorBase#isGroupAggregatedStreamingEvaluator()}): 
a
+ * first pass over the
+ * buffered group sizes precomputes each peer group's value via
+ * {@link #addStreamingGroupResult(int)}
+ * (after {@link #setPartitionSize(int)} has been called), and the regular
+ * streaming pass then just
+ * populates the precomputed values into the output column.
+ */
+public class VectorPTFEvaluatorCumeDist extends VectorPTFEvaluatorBase {
+
+  /**
+   * Per peer group cume_dist values computed in the first pass and consumed, 
in
+   * order, by the
+   * streaming pass (one value is popped when a group's last batch is 
processed).

Review Comment:
   done, formatted



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to