zratkai commented on code in PR #5269:
URL: https://github.com/apache/hive/pull/5269#discussion_r1620342211


##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/HiveMetaStoreAuthorizer.java:
##########
@@ -213,15 +214,46 @@ public final List<String> filterCatalogs(List<String> 
catalogs) throws MetaExcep
 
   @Override
   @Deprecated
-  public List<TableMeta> filterTableMetas(String catName, String 
dbName,List<TableMeta> tableMetas)
+  public List<TableMeta> filterTableMetas(String catName, String dbName, 
List<TableMeta> tableMetas)
       throws MetaException {
-    return filterTableMetas(tableMetas);
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("==> HiveMetaStoreAuthorizer.filterTableMetas()");
+    }
+    List<String> tableNames = new ArrayList<>();
+    List<TableMeta> filteredTableMetas = new ArrayList<>();
+    if (tableMetas != null) {
+      for (TableMeta tableMeta : tableMetas) {
+        tableNames.add(tableMeta.getTableName());
+      }
+      TableFilterContext     tableFilterContext     = new 
TableFilterContext(dbName, tableNames);
+      HiveMetaStoreAuthzInfo hiveMetaStoreAuthzInfo = 
tableFilterContext.getAuthzContext();
+      final List<String>  filteredTableNames = 
filterTableNames(hiveMetaStoreAuthzInfo, dbName, tableNames);
+      if (CollectionUtils.isEmpty(filteredTableNames)) {
+        filteredTableMetas = Collections.emptyList();
+        if (LOG.isInfoEnabled()) {
+          LOG.info("<== HiveMetaStoreAuthorizer.filterTableMetas() : returning 
empty set");
+        }
+      } else {
+        if (LOG.isDebugEnabled()) {

Review Comment:
   No need to check LOG.isDebugEnabled(), since LOG.debug will only output, 
when debug level logging is enabled.



-- 
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.

To unsubscribe, e-mail: [email protected]

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