{"action":"closed","number":12206,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/12206","id":65472203,"html_url":"https://github.com/apache/spark/pull/12206","diff_url":"https://github.com/apache/spark/pull/12206.diff","patch_url":"https://github.com/apache/spark/pull/12206.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/12206","number":12206,"state":"closed","locked":false,"title":"[SPARK-14429] [SQL] Improve LIKE pattern in \"SHOW TABLES / FUNCTIONS LIKE <pattern>\" DDL","user":{"login":"bomeng","id":295781,"avatar_url":"https://avatars.githubusercontent.com/u/295781?v=3","gravatar_id":"","url":"https://api.github.com/users/bomeng","html_url":"https://github.com/bomeng","followers_url":"https://api.github.com/users/bomeng/followers","following_url":"https://api.github.com/users/bomeng/following{/other_user}","gists_url":"https://api.github.com/users/bomeng/gists{/gist_id}","starred_url":"https://api.github.com/users/bomeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bomeng/subscriptions","organizations_url":"https://api.github.com/users/bomeng/orgs","repos_url":"https://api.github.com/users/bomeng/repos","events_url":"https://api.github.com/users/bomeng/events{/privacy}","received_events_url":"https://api.github.com/users/bomeng/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nLIKE <pattern> is commonly used in SHOW TABLES / FUNCTIONS etc DDL. In the pattern, user can use `|` or `*` as wildcards.\r\n\r\n1. Currently, we used `replaceAll()` to replace `*` with `.*`, but the replacement was scattered in several places; I have created an utility method and use it in all the places;\r\n\r\n2. Consistency with Hive: the pattern is case insensitive in Hive and white spaces will be trimmed, but current pattern matching does not do that. For example, suppose we have tables (t1, t2, t3), `SHOW TABLES LIKE ' T* ' ` will list all the t-tables. Please use Hive to verify it.\r\n\r\n3. Combined with `|`, the result will be sorted. For pattern like `'  B*|a*  '`, it will list the result in a-b order.\r\n\r\nI've made some changes to the utility method to make sure we will get the same result as Hive does.\r\n\r\n## How was this patch tested?\r\n\r\nA new method was created in StringUtil and test cases were added.\r\n\r\n@andrewor14 \r\n\r\n\r\n","created_at":"2016-04-06T14:07:25Z","updated_at":"2016-04-06T18:08:06Z","closed_at":"2016-04-06T18:08:06Z","merged_at":null,"merge_commit_sha":"50bfe9a48f22520f48dfe7f6d552cb12bcc4d75e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/12206/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/12206/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/12206/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/b76ccd826a5c7780c73332e059cd31a8daee68a1","head":{"label":"bomeng:SPARK-14429","ref":"SPARK-14429","sha":"b76ccd826a5c7780c73332e059cd31a8daee68a1","user":{"login":"bomeng","id":295781,"avatar_url":"https://avatars.githubusercontent.com/u/295781?v=3","gravatar_id":"","url":"https://api.github.com/users/bomeng","html_url":"https://github.com/bomeng","followers_url":"https://api.github.com/users/bomeng/followers","following_url":"https://api.github.com/users/bomeng/following{/other_user}","gists_url":"https://api.github.com/users/bomeng/gists{/gist_id}","starred_url":"https://api.github.com/users/bomeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bomeng/subscriptions","organizations_url":"https://api.github.com/users/bomeng/orgs","repos_url":"https://api.github.com/users/bomeng/repos","events_url":"https://api.github.com/users/bomeng/events{/privacy}","received_events_url":"https://api.github.com/users/bomeng/received_events","type":"User","site_admin":false},"repo":{"id":47588044,"name":"spark","full_name":"bomeng/spark","owner":{"login":"bomeng","id":295781,"avatar_url":"https://avatars.githubusercontent.com/u/295781?v=3","gravatar_id":"","url":"https://api.github.com/users/bomeng","html_url":"https://github.com/bomeng","followers_url":"https://api.github.com/users/bomeng/followers","following_url":"https://api.github.com/users/bomeng/following{/other_user}","gists_url":"https://api.github.com/users/bomeng/gists{/gist_id}","starred_url":"https://api.github.com/users/bomeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bomeng/subscriptions","organizations_url":"https://api.github.com/users/bomeng/orgs","repos_url":"https://api.github.com/users/bomeng/repos","events_url":"https://api.github.com/users/bomeng/events{/privacy}","received_events_url":"https://api.github.com/users/bomeng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bomeng/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/bomeng/spark","forks_url":"https://api.github.com/repos/bomeng/spark/forks","keys_url":"https://api.github.com/repos/bomeng/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bomeng/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bomeng/spark/teams","hooks_url":"https://api.github.com/repos/bomeng/spark/hooks","issue_events_url":"https://api.github.com/repos/bomeng/spark/issues/events{/number}","events_url":"https://api.github.com/repos/bomeng/spark/events","assignees_url":"https://api.github.com/repos/bomeng/spark/assignees{/user}","branches_url":"https://api.github.com/repos/bomeng/spark/branches{/branch}","tags_url":"https://api.github.com/repos/bomeng/spark/tags","blobs_url":"https://api.github.com/repos/bomeng/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bomeng/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bomeng/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/bomeng/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bomeng/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/bomeng/spark/languages","stargazers_url":"https://api.github.com/repos/bomeng/spark/stargazers","contributors_url":"https://api.github.com/repos/bomeng/spark/contributors","subscribers_url":"https://api.github.com/repos/bomeng/spark/subscribers","subscription_url":"https://api.github.com/repos/bomeng/spark/subscription","commits_url":"https://api.github.com/repos/bomeng/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/bomeng/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/bomeng/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/bomeng/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/bomeng/spark/contents/{+path}","compare_url":"https://api.github.com/repos/bomeng/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bomeng/spark/merges","archive_url":"https://api.github.com/repos/bomeng/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bomeng/spark/downloads","issues_url":"https://api.github.com/repos/bomeng/spark/issues{/number}","pulls_url":"https://api.github.com/repos/bomeng/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/bomeng/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/bomeng/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bomeng/spark/labels{/name}","releases_url":"https://api.github.com/repos/bomeng/spark/releases{/id}","deployments_url":"https://api.github.com/repos/bomeng/spark/deployments","created_at":"2015-12-08T00:27:00Z","updated_at":"2016-01-14T22:59:24Z","pushed_at":"2016-04-06T17:54:28Z","git_url":"git://github.com/bomeng/spark.git","ssh_url":"git@github.com:bomeng/spark.git","clone_url":"https://github.com/bomeng/spark.git","svn_url":"https://github.com/bomeng/spark","homepage":null,"size":155538,"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":"25a4c8e0c5c63ca4722b1da6182e0e0f0f48b73a","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}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2016-04-06T15:28:50Z","pushed_at":"2016-04-06T18:06:39Z","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":452739,"stargazers_count":8035,"watchers_count":8035,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7431,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":424,"forks":7431,"open_issues":424,"watchers":8035,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/12206"},"html":{"href":"https://github.com/apache/spark/pull/12206"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/12206"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/12206/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/12206/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/12206/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/b76ccd826a5c7780c73332e059cd31a8daee68a1"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":3,"review_comments":2,"commits":1,"additions":47,"deletions":24,"changed_files":5}}