use of io.trino.plugin.hive.HiveViewNotSupportedException in project trino by trinodb.
the class SqlStandardAccessControlMetadata method listTablePrivileges.
@Override
public List<GrantInfo> listTablePrivileges(ConnectorSession session, List<SchemaTableName> tableNames) {
Set<HivePrincipal> principals = ThriftMetastoreUtil.listEnabledPrincipals(session.getIdentity(), metastore::listRoleGrants).collect(toImmutableSet());
boolean isAdminRoleSet = hasAdminRole(principals);
ImmutableList.Builder<GrantInfo> result = ImmutableList.builder();
for (SchemaTableName tableName : tableNames) {
try {
result.addAll(buildGrants(principals, isAdminRoleSet, tableName));
} catch (TableNotFoundException e) {
// table disappeared during listing operation
} catch (HiveViewNotSupportedException e) {
// table is an unsupported hive view but shouldn't fail listTablePrivileges.
}
}
return result.build();
}
Aggregations