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