Search in sources :

Example 1 with ConnectorTableLayoutResult

use of com.facebook.presto.spi.ConnectorTableLayoutResult in project presto by prestodb.

the class AccumuloMetadata method getTableLayouts.

@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) {
    AccumuloTableHandle tableHandle = (AccumuloTableHandle) table;
    ConnectorTableLayout layout = new ConnectorTableLayout(new AccumuloTableLayoutHandle(tableHandle, constraint.getSummary()));
    return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
Also used : AccumuloTableLayoutHandle(com.facebook.presto.accumulo.model.AccumuloTableLayoutHandle) ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) ConnectorTableLayout(com.facebook.presto.spi.ConnectorTableLayout) AccumuloTableHandle(com.facebook.presto.accumulo.model.AccumuloTableHandle)

Example 2 with ConnectorTableLayoutResult

use of com.facebook.presto.spi.ConnectorTableLayoutResult in project presto by prestodb.

the class HiveMetadata method getTableLayouts.

@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle tableHandle, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) {
    HiveTableHandle handle = (HiveTableHandle) tableHandle;
    HivePartitionResult hivePartitionResult = partitionManager.getPartitions(metastore, tableHandle, constraint);
    return ImmutableList.of(new ConnectorTableLayoutResult(getTableLayout(session, new HiveTableLayoutHandle(handle.getClientId(), ImmutableList.copyOf(hivePartitionResult.getPartitionColumns()), hivePartitionResult.getPartitions(), hivePartitionResult.getEnforcedConstraint(), hivePartitionResult.getBucketHandle())), hivePartitionResult.getUnenforcedConstraint()));
}
Also used : ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult)

Example 3 with ConnectorTableLayoutResult

use of com.facebook.presto.spi.ConnectorTableLayoutResult in project presto by prestodb.

the class BlackHoleMetadata method getTableLayouts.

@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle handle, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) {
    BlackHoleTableHandle blackHoleHandle = (BlackHoleTableHandle) handle;
    BlackHoleTableLayoutHandle layoutHandle = new BlackHoleTableLayoutHandle(blackHoleHandle.getSplitCount(), blackHoleHandle.getPagesPerSplit(), blackHoleHandle.getRowsPerPage(), blackHoleHandle.getFieldsLength(), blackHoleHandle.getPageProcessingDelay());
    return ImmutableList.of(new ConnectorTableLayoutResult(getTableLayout(session, layoutHandle), TupleDomain.all()));
}
Also used : ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult)

Example 4 with ConnectorTableLayoutResult

use of com.facebook.presto.spi.ConnectorTableLayoutResult in project presto by prestodb.

the class JdbcMetadata method getTableLayouts.

@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) {
    JdbcTableHandle tableHandle = (JdbcTableHandle) table;
    ConnectorTableLayout layout = new ConnectorTableLayout(new JdbcTableLayoutHandle(tableHandle, constraint.getSummary()));
    return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
Also used : ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) ConnectorTableLayout(com.facebook.presto.spi.ConnectorTableLayout)

Example 5 with ConnectorTableLayoutResult

use of com.facebook.presto.spi.ConnectorTableLayoutResult in project presto by prestodb.

the class JmxMetadata method getTableLayouts.

@Override
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) {
    JmxTableHandle handle = (JmxTableHandle) table;
    ConnectorTableLayout layout = new ConnectorTableLayout(new JmxTableLayoutHandle(handle, constraint.getSummary()));
    return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary()));
}
Also used : ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) ConnectorTableLayout(com.facebook.presto.spi.ConnectorTableLayout)

Aggregations

ConnectorTableLayoutResult (com.facebook.presto.spi.ConnectorTableLayoutResult)38 ConnectorTableLayout (com.facebook.presto.spi.ConnectorTableLayout)28 ColumnHandle (com.facebook.presto.spi.ColumnHandle)20 Test (org.testng.annotations.Test)19 ConnectorSplitSource (com.facebook.presto.spi.ConnectorSplitSource)18 Constraint (com.facebook.presto.spi.Constraint)18 ConnectorTableHandle (com.facebook.presto.spi.ConnectorTableHandle)17 ConnectorTableMetadata (com.facebook.presto.spi.ConnectorTableMetadata)17 Map (java.util.Map)17 ColumnMetadata (com.facebook.presto.spi.ColumnMetadata)16 ConnectorOutputTableHandle (com.facebook.presto.spi.ConnectorOutputTableHandle)16 ConnectorSession (com.facebook.presto.spi.ConnectorSession)16 ConnectorSplit (com.facebook.presto.spi.ConnectorSplit)16 SchemaTableName (com.facebook.presto.spi.SchemaTableName)16 TupleDomain (com.facebook.presto.spi.predicate.TupleDomain)16 ImmutableList (com.google.common.collect.ImmutableList)16 ImmutableMap (com.google.common.collect.ImmutableMap)16 Set (java.util.Set)16 ConnectorMetadata (com.facebook.presto.spi.connector.ConnectorMetadata)15 GroupByHashPageIndexerFactory (com.facebook.presto.GroupByHashPageIndexerFactory)14