Search in sources :

Example 6 with ColumnStatisticType

use of com.facebook.presto.spi.statistics.ColumnStatisticType in project presto by prestodb.

the class TestStatisticsWriterNode method createTestDescriptor.

private static StatisticAggregationsDescriptor<VariableReferenceExpression> createTestDescriptor() {
    StatisticAggregationsDescriptor.Builder<VariableReferenceExpression> builder = StatisticAggregationsDescriptor.builder();
    PlanVariableAllocator variableAllocator = new PlanVariableAllocator();
    for (String column : COLUMNS) {
        for (ColumnStatisticType type : ColumnStatisticType.values()) {
            builder.addColumnStatistic(new ColumnStatisticMetadata(column, type), testVariable(variableAllocator));
        }
        builder.addGrouping(column, testVariable(variableAllocator));
    }
    builder.addTableStatistic(ROW_COUNT, testVariable(variableAllocator));
    return builder.build();
}
Also used : ColumnStatisticMetadata(com.facebook.presto.spi.statistics.ColumnStatisticMetadata) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) ColumnStatisticType(com.facebook.presto.spi.statistics.ColumnStatisticType) PlanVariableAllocator(com.facebook.presto.sql.planner.PlanVariableAllocator)

Aggregations

ColumnStatisticType (com.facebook.presto.spi.statistics.ColumnStatisticType)6 ColumnStatisticMetadata (com.facebook.presto.spi.statistics.ColumnStatisticMetadata)5 PrestoException (com.facebook.presto.spi.PrestoException)4 MoreFutures.toCompletableFuture (com.facebook.airlift.concurrent.MoreFutures.toCompletableFuture)2 JsonCodec (com.facebook.airlift.json.JsonCodec)2 JsonCodec.jsonCodec (com.facebook.airlift.json.JsonCodec.jsonCodec)2 SmileCodec (com.facebook.airlift.json.smile.SmileCodec)2 Subfield (com.facebook.presto.common.Subfield)2 Block (com.facebook.presto.common.block.Block)2 Domain (com.facebook.presto.common.predicate.Domain)2 NullableValue (com.facebook.presto.common.predicate.NullableValue)2 TupleDomain (com.facebook.presto.common.predicate.TupleDomain)2 TupleDomain.withColumnDomains (com.facebook.presto.common.predicate.TupleDomain.withColumnDomains)2 ArrayType (com.facebook.presto.common.type.ArrayType)2 BIGINT (com.facebook.presto.common.type.BigintType.BIGINT)2 BOOLEAN (com.facebook.presto.common.type.BooleanType.BOOLEAN)2 Chars.isCharType (com.facebook.presto.common.type.Chars.isCharType)2 DATE (com.facebook.presto.common.type.DateType.DATE)2 MapType (com.facebook.presto.common.type.MapType)2 RowType (com.facebook.presto.common.type.RowType)2