Returns a list of columns of a table using 'matcher' and are accessible to the given user.
(FeTable table, PatternMatcher matcher,
User user)
| 1407 | * to the given user. |
| 1408 | */ |
| 1409 | public List<Column> getColumns(FeTable table, PatternMatcher matcher, |
| 1410 | User user) throws InternalException { |
| 1411 | Preconditions.checkNotNull(table); |
| 1412 | Preconditions.checkNotNull(matcher); |
| 1413 | List<Column> columns = Lists.newArrayList(); |
| 1414 | for (Column column: table.getColumnsInHiveOrder()) { |
| 1415 | String colName = column.getName(); |
| 1416 | if (!matcher.matches(colName)) continue; |
| 1417 | if (authzFactory_.getAuthorizationConfig().isEnabled()) { |
| 1418 | PrivilegeRequest privilegeRequest = new PrivilegeRequestBuilder( |
| 1419 | authzFactory_.getAuthorizableFactory()) |
| 1420 | .any().onColumn(table.getTableName().getDb(), table.getTableName().getTbl(), |
| 1421 | colName, table.getOwnerUser()).build(); |
| 1422 | if (!authzChecker_.get().hasAccess(user, privilegeRequest)) continue; |
| 1423 | } |
| 1424 | columns.add(column); |
| 1425 | } |
| 1426 | return columns; |
| 1427 | } |
| 1428 | |
| 1429 | /** |
| 1430 | * Returns a list of primary keys for a given table only if the user has access to all |
nothing calls this directly
no test coverage detected