drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adeneche <...@git.apache.org>
Subject [GitHub] drill pull request: Drill 3952
Date Mon, 02 Nov 2015 18:00:05 GMT
Github user adeneche commented on a diff in the pull request:

    https://github.com/apache/drill/pull/222#discussion_r43658717
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/DefaultFrameTemplate.java
---
    @@ -287,6 +318,36 @@ private int countPeers(final int start) {
       }
     
       /**
    +   * Counts how many rows are peer with the first row of the current frame. This is called
when we don't require all
    +   * batches of current partition to be processed at once.<br>
    +   * Assumes the end of the frame has indeed been found, because of this it doesn't use
partition.remaining to check
    +   * the end of current partition but rather isSamePartition()
    +   * @param start first row of current frame
    +   * @return number of peer rows
    +   */
    +  private int countPeersPartialPartition(final int start) {
    +    // current frame always starts from first batch
    +    final VectorAccessible first = getCurrent();
    +    int length = 0;
    +
    +    // count all rows that are in the same frame of starting row
    +    // keep increasing length until we find first non peer row we reach the very
    +    // last batch
    +    for (WindowDataBatch batch : batches) {
    +      final int recordCount = batch.getRecordCount();
    +
    +      // for every remaining row in the partition, count it if it's a peer row
    +      for (int row = (batch == first) ? start : 0; row < recordCount; row++, length++)
{
    +        if (!isSamePartition(start, first, row, batch) || !isPeer(start, first, row,
batch)) {
    --- End diff --
    
    why not. We still need to have a separate `isSamePartition` though


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