{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/34223797","id":34223797,"diff_hunk":"@@ -206,6 +206,30 @@ public UTF8String toLowerCase() {\n     return fromString(toString().toLowerCase());\n   }\n \n+  /**\n+   * Returns the index of the string `match` in this String. This string has to be a comma separated\n+   * list. If `match` contains a comma 0 will be returned. If the `match` isn't part of this String,\n+   * -1 will be returned, else the index of match (1-based index)\n+   */\n+  public int findInSet(UTF8String match) {\n+    if (match.contains(UTF8String.fromString(\",\"))) {\n+      return 0;\n+    }\n+\n+    int lastComma = -1;\n+    for (int i = 0, n = 1; i < numBytes; i++) {\n+      if (getByte(i) == 44) {","path":"unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java","position":16,"original_position":16,"commit_id":"61b8ca2bb3b6583623066c1a84de0e45c95aa1cf","original_commit_id":"61b8ca2bb3b6583623066c1a84de0e45c95aa1cf","user":{"login":"tarekauel","id":5320817,"avatar_url":"https://avatars.githubusercontent.com/u/5320817?v=3","gravatar_id":"","url":"https://api.github.com/users/tarekauel","html_url":"https://github.com/tarekauel","followers_url":"https://api.github.com/users/tarekauel/followers","following_url":"https://api.github.com/users/tarekauel/following{/other_user}","gists_url":"https://api.github.com/users/tarekauel/gists{/gist_id}","starred_url":"https://api.github.com/users/tarekauel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarekauel/subscriptions","organizations_url":"https://api.github.com/users/tarekauel/orgs","repos_url":"https://api.github.com/users/tarekauel/repos","events_url":"https://api.github.com/users/tarekauel/events{/privacy}","received_events_url":"https://api.github.com/users/tarekauel/received_events","type":"User","site_admin":false},"body":"One comment to this. 44 as bitstring is `00101100` (http://www.fileformat.info/info/unicode/char/2c/index.htm). Just ASCII characters can start with `00`, see https://en.wikipedia.org/wiki/UTF-8.","created_at":"2015-07-09T05:00:48Z","updated_at":"2015-07-09T05:00:48Z","html_url":"https://github.com/apache/spark/pull/7186#discussion_r34223797","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/7186","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/34223797"},"html":{"href":"https://github.com/apache/spark/pull/7186#discussion_r34223797"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/7186"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/7186","id":39063723,"html_url":"https://github.com/apache/spark/pull/7186","diff_url":"https://github.com/apache/spark/pull/7186.diff","patch_url":"https://github.com/apache/spark/pull/7186.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/7186","number":7186,"state":"open","locked":false,"title":"[Spark-8244][SQL] string function: find in set","user":{"login":"tarekauel","id":5320817,"avatar_url":"https://avatars.githubusercontent.com/u/5320817?v=3","gravatar_id":"","url":"https://api.github.com/users/tarekauel","html_url":"https://github.com/tarekauel","followers_url":"https://api.github.com/users/tarekauel/followers","following_url":"https://api.github.com/users/tarekauel/following{/other_user}","gists_url":"https://api.github.com/users/tarekauel/gists{/gist_id}","starred_url":"https://api.github.com/users/tarekauel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarekauel/subscriptions","organizations_url":"https://api.github.com/users/tarekauel/orgs","repos_url":"https://api.github.com/users/tarekauel/repos","events_url":"https://api.github.com/users/tarekauel/events{/privacy}","received_events_url":"https://api.github.com/users/tarekauel/received_events","type":"User","site_admin":false},"body":"Jira https://issues.apache.org/jira/browse/SPARK-8244\r\n\r\n@rxin Is the expected value for 'not found' `0`or `-1`?","created_at":"2015-07-02T09:29:08Z","updated_at":"2015-07-09T05:00:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71af12bfdc256ff5029d31b09014011c78d00daa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/7186/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/7186/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/7186/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/61b8ca2bb3b6583623066c1a84de0e45c95aa1cf","head":{"label":"tarekauel:SPARK-8244","ref":"SPARK-8244","sha":"61b8ca2bb3b6583623066c1a84de0e45c95aa1cf","user":{"login":"tarekauel","id":5320817,"avatar_url":"https://avatars.githubusercontent.com/u/5320817?v=3","gravatar_id":"","url":"https://api.github.com/users/tarekauel","html_url":"https://github.com/tarekauel","followers_url":"https://api.github.com/users/tarekauel/followers","following_url":"https://api.github.com/users/tarekauel/following{/other_user}","gists_url":"https://api.github.com/users/tarekauel/gists{/gist_id}","starred_url":"https://api.github.com/users/tarekauel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarekauel/subscriptions","organizations_url":"https://api.github.com/users/tarekauel/orgs","repos_url":"https://api.github.com/users/tarekauel/repos","events_url":"https://api.github.com/users/tarekauel/events{/privacy}","received_events_url":"https://api.github.com/users/tarekauel/received_events","type":"User","site_admin":false},"repo":{"id":36629285,"name":"spark","full_name":"tarekauel/spark","owner":{"login":"tarekauel","id":5320817,"avatar_url":"https://avatars.githubusercontent.com/u/5320817?v=3","gravatar_id":"","url":"https://api.github.com/users/tarekauel","html_url":"https://github.com/tarekauel","followers_url":"https://api.github.com/users/tarekauel/followers","following_url":"https://api.github.com/users/tarekauel/following{/other_user}","gists_url":"https://api.github.com/users/tarekauel/gists{/gist_id}","starred_url":"https://api.github.com/users/tarekauel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarekauel/subscriptions","organizations_url":"https://api.github.com/users/tarekauel/orgs","repos_url":"https://api.github.com/users/tarekauel/repos","events_url":"https://api.github.com/users/tarekauel/events{/privacy}","received_events_url":"https://api.github.com/users/tarekauel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tarekauel/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/tarekauel/spark","forks_url":"https://api.github.com/repos/tarekauel/spark/forks","keys_url":"https://api.github.com/repos/tarekauel/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tarekauel/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tarekauel/spark/teams","hooks_url":"https://api.github.com/repos/tarekauel/spark/hooks","issue_events_url":"https://api.github.com/repos/tarekauel/spark/issues/events{/number}","events_url":"https://api.github.com/repos/tarekauel/spark/events","assignees_url":"https://api.github.com/repos/tarekauel/spark/assignees{/user}","branches_url":"https://api.github.com/repos/tarekauel/spark/branches{/branch}","tags_url":"https://api.github.com/repos/tarekauel/spark/tags","blobs_url":"https://api.github.com/repos/tarekauel/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tarekauel/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tarekauel/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/tarekauel/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tarekauel/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/tarekauel/spark/languages","stargazers_url":"https://api.github.com/repos/tarekauel/spark/stargazers","contributors_url":"https://api.github.com/repos/tarekauel/spark/contributors","subscribers_url":"https://api.github.com/repos/tarekauel/spark/subscribers","subscription_url":"https://api.github.com/repos/tarekauel/spark/subscription","commits_url":"https://api.github.com/repos/tarekauel/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/tarekauel/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/tarekauel/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/tarekauel/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/tarekauel/spark/contents/{+path}","compare_url":"https://api.github.com/repos/tarekauel/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tarekauel/spark/merges","archive_url":"https://api.github.com/repos/tarekauel/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tarekauel/spark/downloads","issues_url":"https://api.github.com/repos/tarekauel/spark/issues{/number}","pulls_url":"https://api.github.com/repos/tarekauel/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/tarekauel/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/tarekauel/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tarekauel/spark/labels{/name}","releases_url":"https://api.github.com/repos/tarekauel/spark/releases{/id}","created_at":"2015-06-01T00:48:26Z","updated_at":"2015-06-01T00:48:47Z","pushed_at":"2015-07-09T04:58:21Z","git_url":"git://github.com/tarekauel/spark.git","ssh_url":"git@github.com:tarekauel/spark.git","clone_url":"https://github.com/tarekauel/spark.git","svn_url":"https://github.com/tarekauel/spark","homepage":null,"size":112433,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"47ef423f860c3109d50c7e321616b267f4296e34","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":17165658,"name":"spark","full_name":"apache/spark","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/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2015-07-09T03:44:52Z","pushed_at":"2015-07-09T04:58:23Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":1515534,"stargazers_count":4683,"watchers_count":4683,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4148,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":346,"forks":4148,"open_issues":346,"watchers":4683,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/7186"},"html":{"href":"https://github.com/apache/spark/pull/7186"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/7186"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/7186/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/7186/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/7186/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/61b8ca2bb3b6583623066c1a84de0e45c95aa1cf"}}}}