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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to