saihemanth-cloudera commented on code in PR #4601:
URL: https://github.com/apache/hive/pull/4601#discussion_r1294041436


##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/AuthorizationMetaStoreFilterHook.java:
##########
@@ -162,20 +159,18 @@ private List<HivePrivilegeObject> 
tableMetasToPrivilegeObjs(List<TableMeta> tabl
     return objs;
   }
 
-  private ImmutablePair<String, String> tableMetaKey(String dbName, String 
tableName) {
-    return new ImmutablePair(dbName, tableName);
-  }
-
   @Override
   public List<TableMeta> filterTableMetas(List<TableMeta> tableMetas) throws 
MetaException {
     List<HivePrivilegeObject> listObjs = tableMetasToPrivilegeObjs(tableMetas);
     List<HivePrivilegeObject> filteredList = getFilteredObjects(listObjs);
-    Set<ImmutablePair<String, String>> filteredNames = filteredList.stream()
-        .map(e -> tableMetaKey(e.getDbname(), e.getObjectName()))
-        .collect(Collectors.toSet());
-    return tableMetas.stream()
-        .filter(e -> filteredNames.contains(tableMetaKey(e.getDbName(), 
e.getTableName())))

Review Comment:
   The existing implementation's run time complexity is O(N) whereas the 
suggested implementation's complexity is O(NlogN). So, I'm against changing 
this part of the code.



-- 
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: gitbox-unsubscr...@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to