zratkai commented on code in PR #5269:
URL: https://github.com/apache/hive/pull/5269#discussion_r1620341859
##########
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()) {
Review Comment:
No need to check LOG.isInfoEnabled(), since LOG.info will only output, when
info 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]