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

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

                Author: ASF GitHub Bot
            Created on: 01/Apr/21 18:49
            Start Date: 01/Apr/21 18:49
    Worklog Time Spent: 10m 
      Work Description: saihemanth-cloudera commented on a change in pull 
request #1970:
URL: https://github.com/apache/hive/pull/1970#discussion_r605874641



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
##########
@@ -3585,31 +3585,35 @@ public GetTablesResult 
get_table_objects_by_name_req(GetTablesRequest req) throw
       if (dbName == null || dbName.isEmpty()) {
         throw new UnknownDBException("DB name is null or empty");
       }
-      if (tableNames == null) {
-        throw new InvalidOperationException(dbName + " cannot find null 
tables");
-      }
-
-      // The list of table names could contain duplicates. 
RawStore.getTableObjectsByName()
-      // only guarantees returning no duplicate table objects in one batch. If 
we need
-      // to break into multiple batches, remove duplicates first.
-      List<String> distinctTableNames = tableNames;
-      if (distinctTableNames.size() > tableBatchSize) {
-        List<String> lowercaseTableNames = new ArrayList<>();
-        for (String tableName : tableNames) {
-          
lowercaseTableNames.add(org.apache.hadoop.hive.metastore.utils.StringUtils.normalizeIdentifier(tableName));
+      RawStore ms = getMS();
+      if(tablePattern != null){

Review comment:
       Then we'll not be addressing the scenario of table list can be empty and 
table pattern is set to some regex. We'll we returning an empty list in this 
case

##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
##########
@@ -2435,8 +2435,24 @@ public Type getType(String name) throws 
NoSuchObjectException, MetaException, TE
   @Override
   public List<String> getTables(String catName, String dbName, String 
tablePattern)
       throws TException {
-    List<String> tables = client.get_tables(prependCatalogToDbName(catName, 
dbName, conf), tablePattern);
-    return FilterUtils.filterTableNamesIfEnabled(isClientFilterEnabled, 
filterHook, catName, dbName, tables);
+    List<String> tables = new ArrayList<>();
+    GetProjectionsSpec projectionsSpec = new GetProjectionsSpec();
+    List<String> projectedFields = Arrays.asList("dbName", "tableName", 
"owner", "ownerType");

Review comment:
       GetTableProjectionsSpecBuilder is not importable in HiveMetaStoreClient 
class so we'll have to do this in this way only I guess.




-- 
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: 575677)
    Time Spent: 40m  (was: 0.5h)

> 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
>             Fix For: 4.0.0
>
>          Time Spent: 40m
>  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