[ 
https://issues.apache.org/jira/browse/HIVE-24769?focusedWorklogId=569006&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-569006
 ]

ASF GitHub Bot logged work on HIVE-24769:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Mar/21 17:04
            Start Date: 19/Mar/21 17:04
    Worklog Time Spent: 10m 
      Work Description: nrg4878 commented on a change in pull request #1970:
URL: https://github.com/apache/hive/pull/1970#discussion_r597840626



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -1854,13 +1854,21 @@ private MTable getMTable(String catName, String db, 
String table) {
       catName = normalizeIdentifier(catName);
 
       List<String> lowered_tbl_names = new ArrayList<>(tbl_names.size());
-      for (String t : tbl_names) {
-        lowered_tbl_names.add(normalizeIdentifier(t));
+      if(tbl_names != null) {
+        for (String t : tbl_names) {
+          lowered_tbl_names.add(normalizeIdentifier(t));
+        }
       }
 
       query = pm.newQuery(MTable.class);
-      query.setFilter("database.name == db && database.catalogName == cat && 
tbl_names.contains(tableName)");
-      query.declareParameters("java.lang.String db, java.lang.String cat, 
java.util.Collection tbl_names");
+
+      if(tablePattern == null) {

Review comment:
       So this is a bit confusing as we discussed. A cleaner and less confusing 
approach will be to honor both the tbl_names and tablePattern. So you will have 
3 scenarios
   1) tbl_names not empty but tablePattern is null: Old behavior that will 
fetch just the objects for the tables provided.
   2) tbl_names is empty but tablePattern is not null: The behavior you are 
attempting to introduce where HMS will fetch all table object for names 
matching the tablePattern.
   3) tbl_names not empty and tablePattern not null: There is no usage scenario 
in the hive code base currently but this will return table objects for only 
those tables in the tbl_names whose names match the tablePattern. Others names 
in the list will be omitted.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 569006)
    Time Spent: 20m  (was: 10m)

> HiveMetaStore getTables() doesn't have Owner information to filter on it
> ------------------------------------------------------------------------
>
>                 Key: HIVE-24769
>                 URL: https://issues.apache.org/jira/browse/HIVE-24769
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Sai Hemanth Gantasala
>            Assignee: Sai Hemanth Gantasala
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> HiveMetaStoreClient#getTables() api should have table owner information so 
> that they can be used while authorizing in Apache Ranger/Sentry.
>  



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

Reply via email to