{"action":"created","comment":{"url":"https://api.github.com/repos/apache/phoenix/pulls/comments/81419580","pull_request_review_id":2402995,"id":81419580,"diff_hunk":"@@ -76,20 +76,27 @@ public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) {\n     \n     @Override \n     public double estimateRowCount(RelMetadataQuery mq) {\n-        double rows = super.estimateRowCount(mq);        \n+        double rows = super.estimateRowCount(mq);\n+        if(offset != null) {\n+            return Math.max(0, Math.min(RexLiteral.intValue(fetch), rows - RexLiteral.intValue(offset)));\n+        }\n         return Math.min(RexLiteral.intValue(fetch), rows);\n     }\n \n     @Override\n     public QueryPlan implement(PhoenixRelImplementor implementor) {\n         QueryPlan plan = implementor.visitInput(0, (PhoenixQueryRel) getInput());\n         int fetchValue = RexLiteral.intValue(fetch);\n+        int offsetValue = 0;\n+        if (offset != null){\n+            offsetValue = RexLiteral.intValue(offset);\n+        }\n         if (plan.getLimit() == null) {\n-            return plan.limit(fetchValue);\n+            return plan.limit(fetchValue, offsetValue);\n         }\n         \n         return new ClientScanPlan(plan.getContext(), plan.getStatement(), \n                 implementor.getTableMapping().getTableRef(), RowProjector.EMPTY_PROJECTOR, \n-                fetchValue, null, null, OrderBy.EMPTY_ORDER_BY, plan);\n+                fetchValue, offsetValue, null, OrderBy.EMPTY_ORDER_BY, plan);","path":"phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixLimit.java","position":28,"original_position":28,"commit_id":"488259067d5a610efcc946cb92d48070aa4fbdb0","original_commit_id":"488259067d5a610efcc946cb92d48070aa4fbdb0","user":{"login":"maryannxue","id":4171904,"avatar_url":"https://avatars.githubusercontent.com/u/4171904?v=3","gravatar_id":"","url":"https://api.github.com/users/maryannxue","html_url":"https://github.com/maryannxue","followers_url":"https://api.github.com/users/maryannxue/followers","following_url":"https://api.github.com/users/maryannxue/following{/other_user}","gists_url":"https://api.github.com/users/maryannxue/gists{/gist_id}","starred_url":"https://api.github.com/users/maryannxue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maryannxue/subscriptions","organizations_url":"https://api.github.com/users/maryannxue/orgs","repos_url":"https://api.github.com/users/maryannxue/repos","events_url":"https://api.github.com/users/maryannxue/events{/privacy}","received_events_url":"https://api.github.com/users/maryannxue/received_events","type":"User","site_admin":false},"body":"Since either of them could be null, Boolean objects should be used instead of primitive boolean type.","created_at":"2016-09-30T21:16:38Z","updated_at":"2016-09-30T21:23:58Z","html_url":"https://github.com/apache/phoenix/pull/213#discussion_r81419580","pull_request_url":"https://api.github.com/repos/apache/phoenix/pulls/213","_links":{"self":{"href":"https://api.github.com/repos/apache/phoenix/pulls/comments/81419580"},"html":{"href":"https://github.com/apache/phoenix/pull/213#discussion_r81419580"},"pull_request":{"href":"https://api.github.com/repos/apache/phoenix/pulls/213"}}},"pull_request":{"url":"https://api.github.com/repos/apache/phoenix/pulls/213","id":87545957,"html_url":"https://github.com/apache/phoenix/pull/213","diff_url":"https://github.com/apache/phoenix/pull/213.diff","patch_url":"https://github.com/apache/phoenix/pull/213.patch","issue_url":"https://api.github.com/repos/apache/phoenix/issues/213","number":213,"state":"open","locked":false,"title":"PHOENIX-2827 Support OFFSET in Calcite-Phoenix","user":{"login":"lomoree","id":11578648,"avatar_url":"https://avatars.githubusercontent.com/u/11578648?v=3","gravatar_id":"","url":"https://api.github.com/users/lomoree","html_url":"https://github.com/lomoree","followers_url":"https://api.github.com/users/lomoree/followers","following_url":"https://api.github.com/users/lomoree/following{/other_user}","gists_url":"https://api.github.com/users/lomoree/gists{/gist_id}","starred_url":"https://api.github.com/users/lomoree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lomoree/subscriptions","organizations_url":"https://api.github.com/users/lomoree/orgs","repos_url":"https://api.github.com/users/lomoree/repos","events_url":"https://api.github.com/users/lomoree/events{/privacy}","received_events_url":"https://api.github.com/users/lomoree/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-30T18:47:04Z","updated_at":"2016-09-30T21:23:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d681a37add9542df5788ba2f3e80ed0326e27e74","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/phoenix/pulls/213/commits","review_comments_url":"https://api.github.com/repos/apache/phoenix/pulls/213/comments","review_comment_url":"https://api.github.com/repos/apache/phoenix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/phoenix/issues/213/comments","statuses_url":"https://api.github.com/repos/apache/phoenix/statuses/488259067d5a610efcc946cb92d48070aa4fbdb0","head":{"label":"bloomberg:offset","ref":"offset","sha":"488259067d5a610efcc946cb92d48070aa4fbdb0","user":{"login":"bloomberg","id":1416818,"avatar_url":"https://avatars.githubusercontent.com/u/1416818?v=3","gravatar_id":"","url":"https://api.github.com/users/bloomberg","html_url":"https://github.com/bloomberg","followers_url":"https://api.github.com/users/bloomberg/followers","following_url":"https://api.github.com/users/bloomberg/following{/other_user}","gists_url":"https://api.github.com/users/bloomberg/gists{/gist_id}","starred_url":"https://api.github.com/users/bloomberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bloomberg/subscriptions","organizations_url":"https://api.github.com/users/bloomberg/orgs","repos_url":"https://api.github.com/users/bloomberg/repos","events_url":"https://api.github.com/users/bloomberg/events{/privacy}","received_events_url":"https://api.github.com/users/bloomberg/received_events","type":"Organization","site_admin":false},"repo":{"id":64692842,"name":"phoenix","full_name":"bloomberg/phoenix","owner":{"login":"bloomberg","id":1416818,"avatar_url":"https://avatars.githubusercontent.com/u/1416818?v=3","gravatar_id":"","url":"https://api.github.com/users/bloomberg","html_url":"https://github.com/bloomberg","followers_url":"https://api.github.com/users/bloomberg/followers","following_url":"https://api.github.com/users/bloomberg/following{/other_user}","gists_url":"https://api.github.com/users/bloomberg/gists{/gist_id}","starred_url":"https://api.github.com/users/bloomberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bloomberg/subscriptions","organizations_url":"https://api.github.com/users/bloomberg/orgs","repos_url":"https://api.github.com/users/bloomberg/repos","events_url":"https://api.github.com/users/bloomberg/events{/privacy}","received_events_url":"https://api.github.com/users/bloomberg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bloomberg/phoenix","description":"Mirror of Apache Phoenix","fork":true,"url":"https://api.github.com/repos/bloomberg/phoenix","forks_url":"https://api.github.com/repos/bloomberg/phoenix/forks","keys_url":"https://api.github.com/repos/bloomberg/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bloomberg/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bloomberg/phoenix/teams","hooks_url":"https://api.github.com/repos/bloomberg/phoenix/hooks","issue_events_url":"https://api.github.com/repos/bloomberg/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/bloomberg/phoenix/events","assignees_url":"https://api.github.com/repos/bloomberg/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/bloomberg/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/bloomberg/phoenix/tags","blobs_url":"https://api.github.com/repos/bloomberg/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bloomberg/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bloomberg/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/bloomberg/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bloomberg/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/bloomberg/phoenix/languages","stargazers_url":"https://api.github.com/repos/bloomberg/phoenix/stargazers","contributors_url":"https://api.github.com/repos/bloomberg/phoenix/contributors","subscribers_url":"https://api.github.com/repos/bloomberg/phoenix/subscribers","subscription_url":"https://api.github.com/repos/bloomberg/phoenix/subscription","commits_url":"https://api.github.com/repos/bloomberg/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/bloomberg/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/bloomberg/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/bloomberg/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/bloomberg/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/bloomberg/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bloomberg/phoenix/merges","archive_url":"https://api.github.com/repos/bloomberg/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bloomberg/phoenix/downloads","issues_url":"https://api.github.com/repos/bloomberg/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/bloomberg/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/bloomberg/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/bloomberg/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bloomberg/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/bloomberg/phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/bloomberg/phoenix/deployments","created_at":"2016-08-01T18:48:10Z","updated_at":"2016-08-01T18:48:17Z","pushed_at":"2016-09-30T18:45:46Z","git_url":"git://github.com/bloomberg/phoenix.git","ssh_url":"git@github.com:bloomberg/phoenix.git","clone_url":"https://github.com/bloomberg/phoenix.git","svn_url":"https://github.com/bloomberg/phoenix","homepage":null,"size":28306,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:calcite","ref":"calcite","sha":"12a2b22e3108635bd8834ace4e4d70fa8677f47e","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":20473418,"name":"phoenix","full_name":"apache/phoenix","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/phoenix","description":"Mirror of Apache Phoenix","fork":false,"url":"https://api.github.com/repos/apache/phoenix","forks_url":"https://api.github.com/repos/apache/phoenix/forks","keys_url":"https://api.github.com/repos/apache/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/phoenix/teams","hooks_url":"https://api.github.com/repos/apache/phoenix/hooks","issue_events_url":"https://api.github.com/repos/apache/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/apache/phoenix/events","assignees_url":"https://api.github.com/repos/apache/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/apache/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/apache/phoenix/tags","blobs_url":"https://api.github.com/repos/apache/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/phoenix/languages","stargazers_url":"https://api.github.com/repos/apache/phoenix/stargazers","contributors_url":"https://api.github.com/repos/apache/phoenix/contributors","subscribers_url":"https://api.github.com/repos/apache/phoenix/subscribers","subscription_url":"https://api.github.com/repos/apache/phoenix/subscription","commits_url":"https://api.github.com/repos/apache/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/apache/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/phoenix/merges","archive_url":"https://api.github.com/repos/apache/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/phoenix/downloads","issues_url":"https://api.github.com/repos/apache/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/apache/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/apache/phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/apache/phoenix/deployments","created_at":"2014-06-04T07:00:08Z","updated_at":"2016-09-30T15:03:45Z","pushed_at":"2016-09-30T19:47:30Z","git_url":"git://github.com/apache/phoenix.git","ssh_url":"git@github.com:apache/phoenix.git","clone_url":"https://github.com/apache/phoenix.git","svn_url":"https://github.com/apache/phoenix","homepage":null,"size":37445,"stargazers_count":255,"watchers_count":255,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":333,"mirror_url":"git://git.apache.org/phoenix.git","open_issues_count":110,"forks":333,"open_issues":110,"watchers":255,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/phoenix/pulls/213"},"html":{"href":"https://github.com/apache/phoenix/pull/213"},"issue":{"href":"https://api.github.com/repos/apache/phoenix/issues/213"},"comments":{"href":"https://api.github.com/repos/apache/phoenix/issues/213/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/phoenix/pulls/213/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/phoenix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/phoenix/pulls/213/commits"},"statuses":{"href":"https://api.github.com/repos/apache/phoenix/statuses/488259067d5a610efcc946cb92d48070aa4fbdb0"}}}}
{"actor":{"display_login":"maryannxue"}}