Search in sources :

Example 6 with ColumnStatisticMetadata

use of com.facebook.presto.spi.statistics.ColumnStatisticMetadata 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

ColumnStatisticMetadata (com.facebook.presto.spi.statistics.ColumnStatisticMetadata)6 Block (com.facebook.presto.common.block.Block)3 ColumnStatisticType (com.facebook.presto.spi.statistics.ColumnStatisticType)3 StatisticAggregationsDescriptor (com.facebook.presto.sql.planner.plan.StatisticAggregationsDescriptor)3 Test (org.testng.annotations.Test)3 Session (com.facebook.presto.Session)2 LongArrayBlockBuilder (com.facebook.presto.common.block.LongArrayBlockBuilder)2 Type (com.facebook.presto.common.type.Type)2 TableFinishOperatorFactory (com.facebook.presto.operator.TableFinishOperator.TableFinishOperatorFactory)2 PlanNodeId (com.facebook.presto.spi.plan.PlanNodeId)2 VariableReferenceExpression (com.facebook.presto.spi.relation.VariableReferenceExpression)2 PrestoException (com.facebook.presto.spi.PrestoException)1 StandardFunctionResolution (com.facebook.presto.spi.function.StandardFunctionResolution)1 AggregationNode (com.facebook.presto.spi.plan.AggregationNode)1 CallExpression (com.facebook.presto.spi.relation.CallExpression)1 TableStatisticType (com.facebook.presto.spi.statistics.TableStatisticType)1 PlanVariableAllocator (com.facebook.presto.sql.planner.PlanVariableAllocator)1 StatisticAggregations (com.facebook.presto.sql.planner.plan.StatisticAggregations)1 FunctionResolution (com.facebook.presto.sql.relational.FunctionResolution)1 VerifyException (com.google.common.base.VerifyException)1