use of io.cdap.cdap.proto.TableNameInfo in project cdap by caskdata.
the class BaseHiveExploreService method getTables.
@Override
public List<TableNameInfo> getTables(final String namespace) throws ExploreException {
startAndWait();
// TODO check if the database user is allowed to access if security is enabled
try {
String database = getHiveDatabase(namespace);
ImmutableList.Builder<TableNameInfo> builder = ImmutableList.builder();
List<String> tables = getMetaStoreClient().getAllTables(database);
for (String table : tables) {
builder.add(new TableNameInfo(database, table));
}
return builder.build();
} catch (TException e) {
throw new ExploreException("Error connecting to Hive metastore", e);
}
}
Aggregations