{"action":"created","comment":{"url":"https://api.github.com/repos/druid-io/druid/pulls/comments/31673056","id":31673056,"diff_hunk":"@@ -199,7 +200,7 @@ public Comparator getComparator(List<AggregatorFactory> aggregatorSpecs, List<Po\n   @Override\n   public byte[] getCacheKey()\n   {\n-    byte[] previousStopBytes = StringUtils.toUtf8(previousStop);\n+    byte[] previousStopBytes = StringUtils.toUtf8(getPreviousStop());","path":"processing/src/main/java/io/druid/query/topn/AlphaNumericTopNMetricSpec.java","position":34,"original_position":34,"commit_id":"9fb0825707146978c0d7cfc00051d628a1fe182d","original_commit_id":"9fb0825707146978c0d7cfc00051d628a1fe182d","user":{"login":"pjain1","id":11787983,"avatar_url":"https://avatars.githubusercontent.com/u/11787983?v=3","gravatar_id":"","url":"https://api.github.com/users/pjain1","html_url":"https://github.com/pjain1","followers_url":"https://api.github.com/users/pjain1/followers","following_url":"https://api.github.com/users/pjain1/following{/other_user}","gists_url":"https://api.github.com/users/pjain1/gists{/gist_id}","starred_url":"https://api.github.com/users/pjain1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjain1/subscriptions","organizations_url":"https://api.github.com/users/pjain1/orgs","repos_url":"https://api.github.com/users/pjain1/repos","events_url":"https://api.github.com/users/pjain1/events{/privacy}","received_events_url":"https://api.github.com/users/pjain1/received_events","type":"User","site_admin":false},"body":"@fjy Yes, you are right. I missed that. Should I change it to something like - \r\n```\r\npreviousStop == null ? new byte[]{} : StringUtils.toUtf8(previousStop)\r\n```","created_at":"2015-06-03T21:37:52Z","updated_at":"2015-06-03T21:37:52Z","html_url":"https://github.com/druid-io/druid/pull/1412#discussion_r31673056","pull_request_url":"https://api.github.com/repos/druid-io/druid/pulls/1412","_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments/31673056"},"html":{"href":"https://github.com/druid-io/druid/pull/1412#discussion_r31673056"},"pull_request":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1412"}}},"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/1412","id":36756938,"html_url":"https://github.com/druid-io/druid/pull/1412","diff_url":"https://github.com/druid-io/druid/pull/1412.diff","patch_url":"https://github.com/druid-io/druid/pull/1412.patch","issue_url":"https://api.github.com/repos/druid-io/druid/issues/1412","number":1412,"state":"open","locked":false,"title":"NPE fix for TopN query with alphaNumericTopN metric spec","user":{"login":"pjain1","id":11787983,"avatar_url":"https://avatars.githubusercontent.com/u/11787983?v=3","gravatar_id":"","url":"https://api.github.com/users/pjain1","html_url":"https://github.com/pjain1","followers_url":"https://api.github.com/users/pjain1/followers","following_url":"https://api.github.com/users/pjain1/following{/other_user}","gists_url":"https://api.github.com/users/pjain1/gists{/gist_id}","starred_url":"https://api.github.com/users/pjain1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjain1/subscriptions","organizations_url":"https://api.github.com/users/pjain1/orgs","repos_url":"https://api.github.com/users/pjain1/repos","events_url":"https://api.github.com/users/pjain1/events{/privacy}","received_events_url":"https://api.github.com/users/pjain1/received_events","type":"User","site_admin":false},"body":"When previousStop is not specified for AlphaNumericTopN metric spec. It gets set to null in the LexicographicTopNMetricSpec class which throws NPE while querying.","created_at":"2015-06-02T18:05:47Z","updated_at":"2015-06-03T21:37:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03c5babceaeb73445a3bfab961ffc94847a91926","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/druid-io/druid/pulls/1412/commits","review_comments_url":"https://api.github.com/repos/druid-io/druid/pulls/1412/comments","review_comment_url":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/1412/comments","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/9fb0825707146978c0d7cfc00051d628a1fe182d","head":{"label":"pjain1:alphaNumericTopN_NPE_fix","ref":"alphaNumericTopN_NPE_fix","sha":"9fb0825707146978c0d7cfc00051d628a1fe182d","user":{"login":"pjain1","id":11787983,"avatar_url":"https://avatars.githubusercontent.com/u/11787983?v=3","gravatar_id":"","url":"https://api.github.com/users/pjain1","html_url":"https://github.com/pjain1","followers_url":"https://api.github.com/users/pjain1/followers","following_url":"https://api.github.com/users/pjain1/following{/other_user}","gists_url":"https://api.github.com/users/pjain1/gists{/gist_id}","starred_url":"https://api.github.com/users/pjain1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjain1/subscriptions","organizations_url":"https://api.github.com/users/pjain1/orgs","repos_url":"https://api.github.com/users/pjain1/repos","events_url":"https://api.github.com/users/pjain1/events{/privacy}","received_events_url":"https://api.github.com/users/pjain1/received_events","type":"User","site_admin":false},"repo":{"id":33489992,"name":"druid","full_name":"pjain1/druid","owner":{"login":"pjain1","id":11787983,"avatar_url":"https://avatars.githubusercontent.com/u/11787983?v=3","gravatar_id":"","url":"https://api.github.com/users/pjain1","html_url":"https://github.com/pjain1","followers_url":"https://api.github.com/users/pjain1/followers","following_url":"https://api.github.com/users/pjain1/following{/other_user}","gists_url":"https://api.github.com/users/pjain1/gists{/gist_id}","starred_url":"https://api.github.com/users/pjain1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjain1/subscriptions","organizations_url":"https://api.github.com/users/pjain1/orgs","repos_url":"https://api.github.com/users/pjain1/repos","events_url":"https://api.github.com/users/pjain1/events{/privacy}","received_events_url":"https://api.github.com/users/pjain1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pjain1/druid","description":"Real²time Exploratory Analytics on Large Datasets","fork":true,"url":"https://api.github.com/repos/pjain1/druid","forks_url":"https://api.github.com/repos/pjain1/druid/forks","keys_url":"https://api.github.com/repos/pjain1/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pjain1/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pjain1/druid/teams","hooks_url":"https://api.github.com/repos/pjain1/druid/hooks","issue_events_url":"https://api.github.com/repos/pjain1/druid/issues/events{/number}","events_url":"https://api.github.com/repos/pjain1/druid/events","assignees_url":"https://api.github.com/repos/pjain1/druid/assignees{/user}","branches_url":"https://api.github.com/repos/pjain1/druid/branches{/branch}","tags_url":"https://api.github.com/repos/pjain1/druid/tags","blobs_url":"https://api.github.com/repos/pjain1/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pjain1/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pjain1/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/pjain1/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pjain1/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/pjain1/druid/languages","stargazers_url":"https://api.github.com/repos/pjain1/druid/stargazers","contributors_url":"https://api.github.com/repos/pjain1/druid/contributors","subscribers_url":"https://api.github.com/repos/pjain1/druid/subscribers","subscription_url":"https://api.github.com/repos/pjain1/druid/subscription","commits_url":"https://api.github.com/repos/pjain1/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/pjain1/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/pjain1/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/pjain1/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/pjain1/druid/contents/{+path}","compare_url":"https://api.github.com/repos/pjain1/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pjain1/druid/merges","archive_url":"https://api.github.com/repos/pjain1/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pjain1/druid/downloads","issues_url":"https://api.github.com/repos/pjain1/druid/issues{/number}","pulls_url":"https://api.github.com/repos/pjain1/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/pjain1/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/pjain1/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pjain1/druid/labels{/name}","releases_url":"https://api.github.com/repos/pjain1/druid/releases{/id}","created_at":"2015-04-06T15:44:13Z","updated_at":"2015-05-06T21:31:13Z","pushed_at":"2015-06-03T21:24:14Z","git_url":"git://github.com/pjain1/druid.git","ssh_url":"git@github.com:pjain1/druid.git","clone_url":"https://github.com/pjain1/druid.git","svn_url":"https://github.com/pjain1/druid","homepage":"http://druid.io","size":92963,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"druid-io:master","ref":"master","sha":"92d7316ed88b6b994d353262819f8d3ea348d250","user":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"repo":{"id":6358188,"name":"druid","full_name":"druid-io/druid","owner":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/druid-io/druid","description":"Real²time Exploratory Analytics on Large Datasets","fork":false,"url":"https://api.github.com/repos/druid-io/druid","forks_url":"https://api.github.com/repos/druid-io/druid/forks","keys_url":"https://api.github.com/repos/druid-io/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/druid-io/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/druid-io/druid/teams","hooks_url":"https://api.github.com/repos/druid-io/druid/hooks","issue_events_url":"https://api.github.com/repos/druid-io/druid/issues/events{/number}","events_url":"https://api.github.com/repos/druid-io/druid/events","assignees_url":"https://api.github.com/repos/druid-io/druid/assignees{/user}","branches_url":"https://api.github.com/repos/druid-io/druid/branches{/branch}","tags_url":"https://api.github.com/repos/druid-io/druid/tags","blobs_url":"https://api.github.com/repos/druid-io/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/druid-io/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/druid-io/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/druid-io/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/druid-io/druid/languages","stargazers_url":"https://api.github.com/repos/druid-io/druid/stargazers","contributors_url":"https://api.github.com/repos/druid-io/druid/contributors","subscribers_url":"https://api.github.com/repos/druid-io/druid/subscribers","subscription_url":"https://api.github.com/repos/druid-io/druid/subscription","commits_url":"https://api.github.com/repos/druid-io/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/druid-io/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/druid-io/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/druid-io/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/druid-io/druid/contents/{+path}","compare_url":"https://api.github.com/repos/druid-io/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/druid-io/druid/merges","archive_url":"https://api.github.com/repos/druid-io/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/druid-io/druid/downloads","issues_url":"https://api.github.com/repos/druid-io/druid/issues{/number}","pulls_url":"https://api.github.com/repos/druid-io/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/druid-io/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/druid-io/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/druid-io/druid/labels{/name}","releases_url":"https://api.github.com/repos/druid-io/druid/releases{/id}","created_at":"2012-10-23T19:08:07Z","updated_at":"2015-06-03T19:39:54Z","pushed_at":"2015-06-03T21:24:15Z","git_url":"git://github.com/druid-io/druid.git","ssh_url":"git@github.com:druid-io/druid.git","clone_url":"https://github.com/druid-io/druid.git","svn_url":"https://github.com/druid-io/druid","homepage":"http://druid.io","size":175728,"stargazers_count":1762,"watchers_count":1762,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":381,"mirror_url":null,"open_issues_count":150,"forks":381,"open_issues":150,"watchers":1762,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1412"},"html":{"href":"https://github.com/druid-io/druid/pull/1412"},"issue":{"href":"https://api.github.com/repos/druid-io/druid/issues/1412"},"comments":{"href":"https://api.github.com/repos/druid-io/druid/issues/1412/comments"},"review_comments":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1412/comments"},"review_comment":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1412/commits"},"statuses":{"href":"https://api.github.com/repos/druid-io/druid/statuses/9fb0825707146978c0d7cfc00051d628a1fe182d"}}}}