{"action":"created","comment":{"url":"https://api.github.com/repos/apache/drill/pulls/comments/43586273","id":43586273,"diff_hunk":"@@ -287,6 +318,36 @@ private int countPeers(final int start) {\n   }\n \n   /**\n+   * Counts how many rows are peer with the first row of the current frame. This is called when we don't require all\n+   * batches of current partition to be processed at once.<br>\n+   * Assumes the end of the frame has indeed been found, because of this it doesn't use partition.remaining to check\n+   * the end of current partition but rather isSamePartition()\n+   * @param start first row of current frame\n+   * @return number of peer rows\n+   */\n+  private int countPeersPartialPartition(final int start) {\n+    // current frame always starts from first batch\n+    final VectorAccessible first = getCurrent();\n+    int length = 0;\n+\n+    // count all rows that are in the same frame of starting row\n+    // keep increasing length until we find first non peer row we reach the very\n+    // last batch\n+    for (WindowDataBatch batch : batches) {\n+      final int recordCount = batch.getRecordCount();\n+\n+      // for every remaining row in the partition, count it if it's a peer row\n+      for (int row = (batch == first) ? start : 0; row < recordCount; row++, length++) {\n+        if (!isSamePartition(start, first, row, batch) || !isPeer(start, first, row, batch)) {","path":"exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/DefaultFrameTemplate.java","position":177,"original_position":177,"commit_id":"5ed54a963c30a8742a706804df11942812a0a976","original_commit_id":"5ed54a963c30a8742a706804df11942812a0a976","user":{"login":"amansinha100","id":6034475,"avatar_url":"https://avatars.githubusercontent.com/u/6034475?v=3","gravatar_id":"","url":"https://api.github.com/users/amansinha100","html_url":"https://github.com/amansinha100","followers_url":"https://api.github.com/users/amansinha100/followers","following_url":"https://api.github.com/users/amansinha100/following{/other_user}","gists_url":"https://api.github.com/users/amansinha100/gists{/gist_id}","starred_url":"https://api.github.com/users/amansinha100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amansinha100/subscriptions","organizations_url":"https://api.github.com/users/amansinha100/orgs","repos_url":"https://api.github.com/users/amansinha100/repos","events_url":"https://api.github.com/users/amansinha100/events{/privacy}","received_events_url":"https://api.github.com/users/amansinha100/received_events","type":"User","site_admin":false},"body":"I think isPeer() could also check whether two rows are in the same partition...because the notion of peer is only valid within a partition.  This will simplify the generated code a bit. ","created_at":"2015-11-01T19:19:10Z","updated_at":"2015-11-01T19:19:10Z","html_url":"https://github.com/apache/drill/pull/222#discussion_r43586273","pull_request_url":"https://api.github.com/repos/apache/drill/pulls/222","_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/comments/43586273"},"html":{"href":"https://github.com/apache/drill/pull/222#discussion_r43586273"},"pull_request":{"href":"https://api.github.com/repos/apache/drill/pulls/222"}}},"pull_request":{"url":"https://api.github.com/repos/apache/drill/pulls/222","id":48914203,"html_url":"https://github.com/apache/drill/pull/222","diff_url":"https://github.com/apache/drill/pull/222.diff","patch_url":"https://github.com/apache/drill/pull/222.patch","issue_url":"https://api.github.com/repos/apache/drill/issues/222","number":222,"state":"open","locked":false,"title":"Drill 3952","user":{"login":"adeneche","id":8422943,"avatar_url":"https://avatars.githubusercontent.com/u/8422943?v=3","gravatar_id":"","url":"https://api.github.com/users/adeneche","html_url":"https://github.com/adeneche","followers_url":"https://api.github.com/users/adeneche/followers","following_url":"https://api.github.com/users/adeneche/following{/other_user}","gists_url":"https://api.github.com/users/adeneche/gists{/gist_id}","starred_url":"https://api.github.com/users/adeneche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adeneche/subscriptions","organizations_url":"https://api.github.com/users/adeneche/orgs","repos_url":"https://api.github.com/users/adeneche/repos","events_url":"https://api.github.com/users/adeneche/events{/privacy}","received_events_url":"https://api.github.com/users/adeneche/received_events","type":"User","site_admin":false},"body":"Improve Window Functions performance when not all batches are required to process the current batch\r\n\r\nThis patch also improves how the window functions operator handles limits by avoiding processing anymore batches after the kill signal has been received\r\n\r\n@amansinha100 can you please review ? ","created_at":"2015-10-27T18:42:14Z","updated_at":"2015-11-01T19:19:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83e95bc14ec36d2c63fa40b35df3b53080dbc304","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/drill/pulls/222/commits","review_comments_url":"https://api.github.com/repos/apache/drill/pulls/222/comments","review_comment_url":"https://api.github.com/repos/apache/drill/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/drill/issues/222/comments","statuses_url":"https://api.github.com/repos/apache/drill/statuses/5ed54a963c30a8742a706804df11942812a0a976","head":{"label":"adeneche:DRILL-3952.final.rebased","ref":"DRILL-3952.final.rebased","sha":"5ed54a963c30a8742a706804df11942812a0a976","user":{"login":"adeneche","id":8422943,"avatar_url":"https://avatars.githubusercontent.com/u/8422943?v=3","gravatar_id":"","url":"https://api.github.com/users/adeneche","html_url":"https://github.com/adeneche","followers_url":"https://api.github.com/users/adeneche/followers","following_url":"https://api.github.com/users/adeneche/following{/other_user}","gists_url":"https://api.github.com/users/adeneche/gists{/gist_id}","starred_url":"https://api.github.com/users/adeneche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adeneche/subscriptions","organizations_url":"https://api.github.com/users/adeneche/orgs","repos_url":"https://api.github.com/users/adeneche/repos","events_url":"https://api.github.com/users/adeneche/events{/privacy}","received_events_url":"https://api.github.com/users/adeneche/received_events","type":"User","site_admin":false},"repo":{"id":25532970,"name":"incubator-drill","full_name":"adeneche/incubator-drill","owner":{"login":"adeneche","id":8422943,"avatar_url":"https://avatars.githubusercontent.com/u/8422943?v=3","gravatar_id":"","url":"https://api.github.com/users/adeneche","html_url":"https://github.com/adeneche","followers_url":"https://api.github.com/users/adeneche/followers","following_url":"https://api.github.com/users/adeneche/following{/other_user}","gists_url":"https://api.github.com/users/adeneche/gists{/gist_id}","starred_url":"https://api.github.com/users/adeneche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adeneche/subscriptions","organizations_url":"https://api.github.com/users/adeneche/orgs","repos_url":"https://api.github.com/users/adeneche/repos","events_url":"https://api.github.com/users/adeneche/events{/privacy}","received_events_url":"https://api.github.com/users/adeneche/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adeneche/incubator-drill","description":"Mirror of Apache Drill (Incubating)","fork":true,"url":"https://api.github.com/repos/adeneche/incubator-drill","forks_url":"https://api.github.com/repos/adeneche/incubator-drill/forks","keys_url":"https://api.github.com/repos/adeneche/incubator-drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adeneche/incubator-drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adeneche/incubator-drill/teams","hooks_url":"https://api.github.com/repos/adeneche/incubator-drill/hooks","issue_events_url":"https://api.github.com/repos/adeneche/incubator-drill/issues/events{/number}","events_url":"https://api.github.com/repos/adeneche/incubator-drill/events","assignees_url":"https://api.github.com/repos/adeneche/incubator-drill/assignees{/user}","branches_url":"https://api.github.com/repos/adeneche/incubator-drill/branches{/branch}","tags_url":"https://api.github.com/repos/adeneche/incubator-drill/tags","blobs_url":"https://api.github.com/repos/adeneche/incubator-drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adeneche/incubator-drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adeneche/incubator-drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/adeneche/incubator-drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adeneche/incubator-drill/statuses/{sha}","languages_url":"https://api.github.com/repos/adeneche/incubator-drill/languages","stargazers_url":"https://api.github.com/repos/adeneche/incubator-drill/stargazers","contributors_url":"https://api.github.com/repos/adeneche/incubator-drill/contributors","subscribers_url":"https://api.github.com/repos/adeneche/incubator-drill/subscribers","subscription_url":"https://api.github.com/repos/adeneche/incubator-drill/subscription","commits_url":"https://api.github.com/repos/adeneche/incubator-drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/adeneche/incubator-drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/adeneche/incubator-drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/adeneche/incubator-drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/adeneche/incubator-drill/contents/{+path}","compare_url":"https://api.github.com/repos/adeneche/incubator-drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adeneche/incubator-drill/merges","archive_url":"https://api.github.com/repos/adeneche/incubator-drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adeneche/incubator-drill/downloads","issues_url":"https://api.github.com/repos/adeneche/incubator-drill/issues{/number}","pulls_url":"https://api.github.com/repos/adeneche/incubator-drill/pulls{/number}","milestones_url":"https://api.github.com/repos/adeneche/incubator-drill/milestones{/number}","notifications_url":"https://api.github.com/repos/adeneche/incubator-drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adeneche/incubator-drill/labels{/name}","releases_url":"https://api.github.com/repos/adeneche/incubator-drill/releases{/id}","created_at":"2014-10-21T16:25:02Z","updated_at":"2015-05-06T04:08:51Z","pushed_at":"2015-10-29T00:12:57Z","git_url":"git://github.com/adeneche/incubator-drill.git","ssh_url":"git@github.com:adeneche/incubator-drill.git","clone_url":"https://github.com/adeneche/incubator-drill.git","svn_url":"https://github.com/adeneche/incubator-drill","homepage":null,"size":33558,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"1d067d26b1ba510f4a51489d62d2a6d0480a473c","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":5683653,"name":"drill","full_name":"apache/drill","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/drill","description":"Mirror of Apache Drill","fork":false,"url":"https://api.github.com/repos/apache/drill","forks_url":"https://api.github.com/repos/apache/drill/forks","keys_url":"https://api.github.com/repos/apache/drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/drill/teams","hooks_url":"https://api.github.com/repos/apache/drill/hooks","issue_events_url":"https://api.github.com/repos/apache/drill/issues/events{/number}","events_url":"https://api.github.com/repos/apache/drill/events","assignees_url":"https://api.github.com/repos/apache/drill/assignees{/user}","branches_url":"https://api.github.com/repos/apache/drill/branches{/branch}","tags_url":"https://api.github.com/repos/apache/drill/tags","blobs_url":"https://api.github.com/repos/apache/drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/drill/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/drill/languages","stargazers_url":"https://api.github.com/repos/apache/drill/stargazers","contributors_url":"https://api.github.com/repos/apache/drill/contributors","subscribers_url":"https://api.github.com/repos/apache/drill/subscribers","subscription_url":"https://api.github.com/repos/apache/drill/subscription","commits_url":"https://api.github.com/repos/apache/drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/drill/contents/{+path}","compare_url":"https://api.github.com/repos/apache/drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/drill/merges","archive_url":"https://api.github.com/repos/apache/drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/drill/downloads","issues_url":"https://api.github.com/repos/apache/drill/issues{/number}","pulls_url":"https://api.github.com/repos/apache/drill/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/drill/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/drill/labels{/name}","releases_url":"https://api.github.com/repos/apache/drill/releases{/id}","created_at":"2012-09-05T07:00:26Z","updated_at":"2015-10-31T09:54:01Z","pushed_at":"2015-11-01T00:22:33Z","git_url":"git://github.com/apache/drill.git","ssh_url":"git@github.com:apache/drill.git","clone_url":"https://github.com/apache/drill.git","svn_url":"https://github.com/apache/drill","homepage":"","size":49306,"stargazers_count":504,"watchers_count":504,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":329,"mirror_url":"git://git.apache.org/incubator-drill.git","open_issues_count":49,"forks":329,"open_issues":49,"watchers":504,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/222"},"html":{"href":"https://github.com/apache/drill/pull/222"},"issue":{"href":"https://api.github.com/repos/apache/drill/issues/222"},"comments":{"href":"https://api.github.com/repos/apache/drill/issues/222/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/drill/pulls/222/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/drill/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/drill/pulls/222/commits"},"statuses":{"href":"https://api.github.com/repos/apache/drill/statuses/5ed54a963c30a8742a706804df11942812a0a976"}}}}