GitHub user bomeng opened a pull request:
https://github.com/apache/spark/pull/12206
[SPARK-14429] [SQL] Improve LIKE pattern in "SHOW TABLES / FUNCTIONS LIKE
<pattern>" DDL
## What changes were proposed in this pull request?
LIKE <pattern> is commonly used in SHOW TABLES / FUNCTIONS etc DDL. In the
pattern, user can use `|` or `*` as wildcards.
1. 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;
2. 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.
I've made some changes to the utility method to make sure we will get the
same result as Hive does.
## How was this patch tested?
A new method was created in StringUtil and test cases were added.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bomeng/spark SPARK-14429
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12206.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12206
----
commit b76ccd826a5c7780c73332e059cd31a8daee68a1
Author: bomeng <[email protected]>
Date: 2016-04-06T14:01:09Z
fix like pattern in show ddl
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]