{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/7115","labels_url":"https://api.github.com/repos/apache/spark/issues/7115/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/7115/comments","events_url":"https://api.github.com/repos/apache/spark/issues/7115/events","html_url":"https://github.com/apache/spark/pull/7115","id":92017685,"number":7115,"title":"[SPARK-8271][SQL]string function: soundex","user":{"login":"HuJiayin","id":12150346,"avatar_url":"https://avatars.githubusercontent.com/u/12150346?v=3","gravatar_id":"","url":"https://api.github.com/users/HuJiayin","html_url":"https://github.com/HuJiayin","followers_url":"https://api.github.com/users/HuJiayin/followers","following_url":"https://api.github.com/users/HuJiayin/following{/other_user}","gists_url":"https://api.github.com/users/HuJiayin/gists{/gist_id}","starred_url":"https://api.github.com/users/HuJiayin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuJiayin/subscriptions","organizations_url":"https://api.github.com/users/HuJiayin/orgs","repos_url":"https://api.github.com/users/HuJiayin/repos","events_url":"https://api.github.com/users/HuJiayin/events{/privacy}","received_events_url":"https://api.github.com/users/HuJiayin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":104,"created_at":"2015-06-30T07:49:47Z","updated_at":"2015-07-20T01:12:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/7115","html_url":"https://github.com/apache/spark/pull/7115","diff_url":"https://github.com/apache/spark/pull/7115.diff","patch_url":"https://github.com/apache/spark/pull/7115.patch"},"body":"Add soundex for SQL\r\n\r\nIt is written according to https://en.wikipedia.org/wiki/Soundex\r\n1. Retain the first letter of the name and drop all other occurrences of a, e, i, o, u, y, h, w.\r\n2. Replace consonants with digits as follows (after the first letter):\r\n    b, f, p, v → 1\r\n    c, g, j, k, q, s, x, z → 2\r\n    d, t → 3\r\n    l → 4\r\n    m, n → 5\r\n    r → 6\r\n3. If two or more letters with the same number are adjacent in the original name (before step 1), only retain the first letter; also two letters with the same number separated by 'h' or 'w' are coded as a single number, whereas such letters separated by a vowel are coded twice. This rule also applies to the first letter.\r\n4. Iterate the previous step until you have one letter and three numbers. If you have too few letters in your word that you can't assign three numbers, append with zeros until there are three numbers. If you have more than 3 letters, just retain the first 3 numbers.\r\n\r\nUsing this algorithm, both \"Robert\" and \"Rupert\" return the same string \"R163\" while \"Rubin\" yields \"R150\". \"Ashcraft\" and \"Ashcroft\" both yield \"A261\" and not \"A226\" (the chars 's' and 'c' in the name would receive a single number of 2 and not 22 since an 'h' lies in between them). \"Tymczak\" yields \"T522\" not \"T520\" (the chars 'z' and 'k' in the name are coded as 2 twice since a vowel lies in between them). \"Pfister\" yields \"P236\" not \"P123\" (the first two letters have the same number and are coded once as 'P').\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/122724123","html_url":"https://github.com/apache/spark/pull/7115#issuecomment-122724123","issue_url":"https://api.github.com/repos/apache/spark/issues/7115","id":122724123,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars.githubusercontent.com/u/4031291?v=3","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T01:12:14Z","updated_at":"2015-07-20T01:12:14Z","body":" Build triggered."}}