[ 
https://issues.apache.org/jira/browse/HIVE-23243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17087718#comment-17087718
 ] 

David Mollitor commented on HIVE-23243:
---------------------------------------

{code:java|title=ShowDatabasesOperation.java}

List<String> databases = context.getDb().getAllDatabases();
Pattern pattern = 
Pattern.compile(UDFLike.likePatternToRegExp(desc.getPattern()));

/*************************/

databases = context.getDb().getDatabasesByPattern(desc.getPattern());
{code}

Currently, the client passes the pattern to the HMS and I am assuming that HMS 
does the filtering on its side so only the relevant results are returned.  With 
this change, the entire list of databases are returned and then filtered on the 
client side.

I'd like to know what the plan is for the existing HMS API.  Does it need to be 
deprecated and removed?  Does the API need to be changed to accept a generic 
{{Pattern}} instead of of a {{String}}?

> Accept SQL type like pattern for Show Databases
> -----------------------------------------------
>
>                 Key: HIVE-23243
>                 URL: https://issues.apache.org/jira/browse/HIVE-23243
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>            Reporter: Miklos Gergely
>            Assignee: Miklos Gergely
>            Priority: Minor
>         Attachments: HIVE-23243.01.patch
>
>
> Show Databases pattern accepts java like pattern with * and ., use SQL like 
> instead with % and _.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to