{"action":"created","comment":{"url":"https://api.github.com/repos/apache/phoenix/pulls/comments/58640455","id":58640455,"diff_hunk":"@@ -556,35 +564,55 @@ private static String toString(List<byte[]> gps) {\n                 } else {\n                     endKey = regionBoundaries.get(regionIndex);\n                 }\n-                HRegionLocation regionLocation = regionLocations.get(regionIndex);\n-                if (isLocalIndex) {\n-                    HRegionInfo regionInfo = regionLocation.getRegionInfo();\n-                    endRegionKey = regionInfo.getEndKey();\n-                    keyOffset = ScanUtil.getRowKeyOffset(regionInfo.getStartKey(), endRegionKey);\n-                }\n-                try {\n-                    while (guideIndex < gpsSize && (currentGuidePost.compareTo(endKey) <= 0 || endKey.length == 0)) {\n-                        Scan newScan = scanRanges.intersectScan(scan, currentKeyBytes, currentGuidePostBytes, keyOffset,\n-                                false);\n-                        estimatedRows += gps.getRowCounts().get(guideIndex);\n-                        estimatedSize += gps.getByteCounts().get(guideIndex);\n-                        scans = addNewScan(parallelScans, scans, newScan, currentGuidePostBytes, false, regionLocation);\n-                        currentKeyBytes = currentGuidePost.copyBytes();\n-                        currentGuidePost = PrefixByteCodec.decode(decoder, input);\n-                        currentGuidePostBytes = currentGuidePost.copyBytes();\n-                        guideIndex++;\n-                    }\n-                } catch (EOFException e) {}\n-                Scan newScan = scanRanges.intersectScan(scan, currentKeyBytes, endKey, keyOffset, true);\n-                if (isLocalIndex) {\n-                    if (newScan != null) {\n-                        newScan.setAttribute(EXPECTED_UPPER_REGION_KEY, endRegionKey);\n-                    } else if (!scans.isEmpty()) {\n-                        scans.get(scans.size()-1).setAttribute(EXPECTED_UPPER_REGION_KEY, endRegionKey);\n-                    }\n-                }\n-                scans = addNewScan(parallelScans, scans, newScan, endKey, true, regionLocation);\n-                currentKeyBytes = endKey;\n+                if (Bytes.compareTo(scan.getStartRow(), context.getScan().getStartRow()) != 0\n+                     || Bytes.compareTo(scan.getStopRow(), context.getScan().getStopRow()) != 0) {\n+                    Scan newScan = ScanUtil.newScan(scan);\n+                    if(ScanUtil.isLocalIndex(scan)) {\n+                        newScan.setStartRow(regionInfo.getStartKey());\n+                        newScan.setAttribute(SCAN_ACTUAL_START_ROW, regionInfo.getStartKey());","path":"phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java","position":132,"original_position":132,"commit_id":"d2e4d166dc2b32ed725183fc4465378029bd7834","original_commit_id":"d2e4d166dc2b32ed725183fc4465378029bd7834","user":{"login":"chrajeshbabu","id":4728792,"avatar_url":"https://avatars.githubusercontent.com/u/4728792?v=3","gravatar_id":"","url":"https://api.github.com/users/chrajeshbabu","html_url":"https://github.com/chrajeshbabu","followers_url":"https://api.github.com/users/chrajeshbabu/followers","following_url":"https://api.github.com/users/chrajeshbabu/following{/other_user}","gists_url":"https://api.github.com/users/chrajeshbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/chrajeshbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrajeshbabu/subscriptions","organizations_url":"https://api.github.com/users/chrajeshbabu/orgs","repos_url":"https://api.github.com/users/chrajeshbabu/repos","events_url":"https://api.github.com/users/chrajeshbabu/events{/privacy}","received_events_url":"https://api.github.com/users/chrajeshbabu/received_events","type":"User","site_admin":false},"body":"First one is actual start key of the scan second one is end key of region. After this patch we don't need EXPECTED_UPPER_REGION_KEY but kept it for compatibility.","created_at":"2016-04-06T01:29:15Z","updated_at":"2016-04-06T01:29:15Z","html_url":"https://github.com/apache/phoenix/pull/156#discussion_r58640455","pull_request_url":"https://api.github.com/repos/apache/phoenix/pulls/156","_links":{"self":{"href":"https://api.github.com/repos/apache/phoenix/pulls/comments/58640455"},"html":{"href":"https://github.com/apache/phoenix/pull/156#discussion_r58640455"},"pull_request":{"href":"https://api.github.com/repos/apache/phoenix/pulls/156"}}},"pull_request":{"url":"https://api.github.com/repos/apache/phoenix/pulls/156","id":64496605,"html_url":"https://github.com/apache/phoenix/pull/156","diff_url":"https://github.com/apache/phoenix/pull/156.diff","patch_url":"https://github.com/apache/phoenix/pull/156.patch","issue_url":"https://api.github.com/repos/apache/phoenix/issues/156","number":156,"state":"open","locked":false,"title":"PHOENIX-2628 Ensure split when iterating through results handled corr…","user":{"login":"chrajeshbabu","id":4728792,"avatar_url":"https://avatars.githubusercontent.com/u/4728792?v=3","gravatar_id":"","url":"https://api.github.com/users/chrajeshbabu","html_url":"https://github.com/chrajeshbabu","followers_url":"https://api.github.com/users/chrajeshbabu/followers","following_url":"https://api.github.com/users/chrajeshbabu/following{/other_user}","gists_url":"https://api.github.com/users/chrajeshbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/chrajeshbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrajeshbabu/subscriptions","organizations_url":"https://api.github.com/users/chrajeshbabu/orgs","repos_url":"https://api.github.com/users/chrajeshbabu/repos","events_url":"https://api.github.com/users/chrajeshbabu/events{/privacy}","received_events_url":"https://api.github.com/users/chrajeshbabu/received_events","type":"User","site_admin":false},"body":"The patch fixes issues with splits and merges while scanning local indexes.  ","created_at":"2016-03-29T16:46:03Z","updated_at":"2016-04-06T01:29:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec37d5230b622f25c01eb5ecd6a9c3c6aa373767","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/phoenix/pulls/156/commits","review_comments_url":"https://api.github.com/repos/apache/phoenix/pulls/156/comments","review_comment_url":"https://api.github.com/repos/apache/phoenix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/phoenix/issues/156/comments","statuses_url":"https://api.github.com/repos/apache/phoenix/statuses/d2e4d166dc2b32ed725183fc4465378029bd7834","head":{"label":"chrajeshbabu:master","ref":"master","sha":"d2e4d166dc2b32ed725183fc4465378029bd7834","user":{"login":"chrajeshbabu","id":4728792,"avatar_url":"https://avatars.githubusercontent.com/u/4728792?v=3","gravatar_id":"","url":"https://api.github.com/users/chrajeshbabu","html_url":"https://github.com/chrajeshbabu","followers_url":"https://api.github.com/users/chrajeshbabu/followers","following_url":"https://api.github.com/users/chrajeshbabu/following{/other_user}","gists_url":"https://api.github.com/users/chrajeshbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/chrajeshbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrajeshbabu/subscriptions","organizations_url":"https://api.github.com/users/chrajeshbabu/orgs","repos_url":"https://api.github.com/users/chrajeshbabu/repos","events_url":"https://api.github.com/users/chrajeshbabu/events{/privacy}","received_events_url":"https://api.github.com/users/chrajeshbabu/received_events","type":"User","site_admin":false},"repo":{"id":54991540,"name":"phoenix","full_name":"chrajeshbabu/phoenix","owner":{"login":"chrajeshbabu","id":4728792,"avatar_url":"https://avatars.githubusercontent.com/u/4728792?v=3","gravatar_id":"","url":"https://api.github.com/users/chrajeshbabu","html_url":"https://github.com/chrajeshbabu","followers_url":"https://api.github.com/users/chrajeshbabu/followers","following_url":"https://api.github.com/users/chrajeshbabu/following{/other_user}","gists_url":"https://api.github.com/users/chrajeshbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/chrajeshbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrajeshbabu/subscriptions","organizations_url":"https://api.github.com/users/chrajeshbabu/orgs","repos_url":"https://api.github.com/users/chrajeshbabu/repos","events_url":"https://api.github.com/users/chrajeshbabu/events{/privacy}","received_events_url":"https://api.github.com/users/chrajeshbabu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chrajeshbabu/phoenix","description":"Mirror of Apache Phoenix","fork":true,"url":"https://api.github.com/repos/chrajeshbabu/phoenix","forks_url":"https://api.github.com/repos/chrajeshbabu/phoenix/forks","keys_url":"https://api.github.com/repos/chrajeshbabu/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrajeshbabu/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrajeshbabu/phoenix/teams","hooks_url":"https://api.github.com/repos/chrajeshbabu/phoenix/hooks","issue_events_url":"https://api.github.com/repos/chrajeshbabu/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/chrajeshbabu/phoenix/events","assignees_url":"https://api.github.com/repos/chrajeshbabu/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/chrajeshbabu/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/chrajeshbabu/phoenix/tags","blobs_url":"https://api.github.com/repos/chrajeshbabu/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrajeshbabu/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrajeshbabu/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrajeshbabu/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrajeshbabu/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/chrajeshbabu/phoenix/languages","stargazers_url":"https://api.github.com/repos/chrajeshbabu/phoenix/stargazers","contributors_url":"https://api.github.com/repos/chrajeshbabu/phoenix/contributors","subscribers_url":"https://api.github.com/repos/chrajeshbabu/phoenix/subscribers","subscription_url":"https://api.github.com/repos/chrajeshbabu/phoenix/subscription","commits_url":"https://api.github.com/repos/chrajeshbabu/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrajeshbabu/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrajeshbabu/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrajeshbabu/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrajeshbabu/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/chrajeshbabu/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrajeshbabu/phoenix/merges","archive_url":"https://api.github.com/repos/chrajeshbabu/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrajeshbabu/phoenix/downloads","issues_url":"https://api.github.com/repos/chrajeshbabu/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/chrajeshbabu/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/chrajeshbabu/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/chrajeshbabu/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrajeshbabu/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/chrajeshbabu/phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/chrajeshbabu/phoenix/deployments","created_at":"2016-03-29T16:23:55Z","updated_at":"2016-03-29T16:24:00Z","pushed_at":"2016-03-30T09:42:19Z","git_url":"git://github.com/chrajeshbabu/phoenix.git","ssh_url":"git@github.com:chrajeshbabu/phoenix.git","clone_url":"https://github.com/chrajeshbabu/phoenix.git","svn_url":"https://github.com/chrajeshbabu/phoenix","homepage":null,"size":23937,"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:master","ref":"master","sha":"b98805039516bfa706f1fa78ed0850d802df5dc8","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-03-30T11:40:51Z","pushed_at":"2016-04-05T19:49:01Z","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":30518,"stargazers_count":176,"watchers_count":176,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":265,"mirror_url":"git://git.apache.org/phoenix.git","open_issues_count":87,"forks":265,"open_issues":87,"watchers":176,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/phoenix/pulls/156"},"html":{"href":"https://github.com/apache/phoenix/pull/156"},"issue":{"href":"https://api.github.com/repos/apache/phoenix/issues/156"},"comments":{"href":"https://api.github.com/repos/apache/phoenix/issues/156/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/phoenix/pulls/156/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/phoenix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/phoenix/pulls/156/commits"},"statuses":{"href":"https://api.github.com/repos/apache/phoenix/statuses/d2e4d166dc2b32ed725183fc4465378029bd7834"}}}}