use of io.trino.spi.connector.NotFoundException in project trino by trinodb.
the class KuduMetadata method getTableHandle.
@Override
public KuduTableHandle getTableHandle(ConnectorSession session, SchemaTableName schemaTableName) {
try {
KuduTable table = clientSession.openTable(schemaTableName);
OptionalInt bucketCount = OptionalInt.empty();
List<HashBucketSchema> bucketSchemas = table.getPartitionSchema().getHashBucketSchemas();
if (!bucketSchemas.isEmpty()) {
bucketCount = OptionalInt.of(bucketSchemas.stream().mapToInt(HashBucketSchema::getNumBuckets).reduce(1, Math::multiplyExact));
}
return new KuduTableHandle(schemaTableName, table, TupleDomain.all(), Optional.empty(), false, bucketCount, OptionalLong.empty());
} catch (NotFoundException e) {
return null;
}
}
use of io.trino.spi.connector.NotFoundException in project trino by trinodb.
the class CassandraMetadata method listTableColumns.
@Override
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix) {
requireNonNull(prefix, "prefix is null");
ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> columns = ImmutableMap.builder();
for (SchemaTableName tableName : listTables(session, prefix)) {
try {
columns.put(tableName, getTableMetadata(tableName).getColumns());
} catch (NotFoundException e) {
// table disappeared during listing operation
}
}
return columns.buildOrThrow();
}
use of io.trino.spi.connector.NotFoundException in project trino by trinodb.
the class MongoMetadata method listTableColumns.
@Override
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix) {
requireNonNull(prefix, "prefix is null");
ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> columns = ImmutableMap.builder();
for (SchemaTableName tableName : listTables(session, prefix)) {
try {
columns.put(tableName, getTableMetadata(session, tableName).getColumns());
} catch (NotFoundException e) {
// table disappeared during listing operation
}
}
return columns.buildOrThrow();
}
Aggregations