Search in sources :

Example 11 with TableColumn

use of com.facebook.presto.raptor.metadata.TableColumn in project presto by prestodb.

the class RaptorMetadata method getColumnHandles.

@Override
public Map<String, ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle) {
    RaptorTableHandle raptorTableHandle = (RaptorTableHandle) tableHandle;
    ImmutableMap.Builder<String, ColumnHandle> builder = ImmutableMap.builder();
    for (TableColumn tableColumn : dao.listTableColumns(raptorTableHandle.getTableId())) {
        builder.put(tableColumn.getColumnName(), getRaptorColumnHandle(tableColumn));
    }
    RaptorColumnHandle uuidColumn = shardUuidColumnHandle(connectorId);
    builder.put(uuidColumn.getColumnName(), uuidColumn);
    RaptorColumnHandle bucketNumberColumn = bucketNumberColumnHandle(connectorId);
    builder.put(bucketNumberColumn.getColumnName(), bucketNumberColumn);
    return builder.build();
}
Also used : RaptorColumnHandle.shardUuidColumnHandle(com.facebook.presto.raptor.RaptorColumnHandle.shardUuidColumnHandle) ColumnHandle(com.facebook.presto.spi.ColumnHandle) RaptorColumnHandle.bucketNumberColumnHandle(com.facebook.presto.raptor.RaptorColumnHandle.bucketNumberColumnHandle) TableColumn(com.facebook.presto.raptor.metadata.TableColumn) ImmutableMap(com.google.common.collect.ImmutableMap)

Aggregations

TableColumn (com.facebook.presto.raptor.metadata.TableColumn)11 Table (com.facebook.presto.raptor.metadata.Table)4 SchemaTableName (com.facebook.presto.spi.SchemaTableName)4 Type (com.facebook.presto.spi.type.Type)4 ImmutableList (com.google.common.collect.ImmutableList)4 ShardInfo (com.facebook.presto.raptor.metadata.ShardInfo)3 ShardMetadata (com.facebook.presto.raptor.metadata.ShardMetadata)3 ColumnMetadata (com.facebook.presto.spi.ColumnMetadata)3 ImmutableMap (com.google.common.collect.ImmutableMap)3 List (java.util.List)3 RaptorColumnHandle.bucketNumberColumnHandle (com.facebook.presto.raptor.RaptorColumnHandle.bucketNumberColumnHandle)2 RaptorColumnHandle.shardUuidColumnHandle (com.facebook.presto.raptor.RaptorColumnHandle.shardUuidColumnHandle)2 ColumnStats (com.facebook.presto.raptor.metadata.ColumnStats)2 MetadataDao (com.facebook.presto.raptor.metadata.MetadataDao)2 ShardManager (com.facebook.presto.raptor.metadata.ShardManager)2 DatabaseUtil.onDemandDao (com.facebook.presto.raptor.util.DatabaseUtil.onDemandDao)2 ConnectorTableMetadata (com.facebook.presto.spi.ConnectorTableMetadata)2 TableNotFoundException (com.facebook.presto.spi.TableNotFoundException)2 DATE (com.facebook.presto.spi.type.DateType.DATE)2 TIMESTAMP (com.facebook.presto.spi.type.TimestampType.TIMESTAMP)2