MCPcopy Create free account
hub / github.com/apache/impala / getColumns

Method getColumns

fe/src/main/java/org/apache/impala/service/Frontend.java:1409–1427  ·  view source on GitHub ↗

Returns a list of columns of a table using 'matcher' and are accessible to the given user.

(FeTable table, PatternMatcher matcher,
      User user)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

anyMethod · 0.80
getColumnsInHiveOrderMethod · 0.65
getNameMethod · 0.65
matchesMethod · 0.65
isEnabledMethod · 0.65
getDbMethod · 0.65
getTableNameMethod · 0.65
getOwnerUserMethod · 0.65
hasAccessMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected