Search in sources :

Example 1 with ParameterType

use of com.facebook.presto.operator.aggregation.AggregationMetadata.ParameterMetadata.ParameterType in project presto by prestodb.

the class ParametricAggregation method buildParameterMetadata.

private static List<ParameterMetadata> buildParameterMetadata(List<ParameterType> parameterMetadataTypes, List<Type> inputTypes) {
    ImmutableList.Builder<ParameterMetadata> builder = ImmutableList.builder();
    int inputId = 0;
    for (ParameterType parameterMetadataType : parameterMetadataTypes) {
        switch(parameterMetadataType) {
            case STATE:
            case BLOCK_INDEX:
                builder.add(new ParameterMetadata(parameterMetadataType));
                break;
            case INPUT_CHANNEL:
            case BLOCK_INPUT_CHANNEL:
            case NULLABLE_BLOCK_INPUT_CHANNEL:
                builder.add(new ParameterMetadata(parameterMetadataType, inputTypes.get(inputId++)));
                break;
        }
    }
    return builder.build();
}
Also used : ParameterType(com.facebook.presto.operator.aggregation.AggregationMetadata.ParameterMetadata.ParameterType) ImmutableList(com.google.common.collect.ImmutableList) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ParameterMetadata(com.facebook.presto.operator.aggregation.AggregationMetadata.ParameterMetadata)

Aggregations

ParameterMetadata (com.facebook.presto.operator.aggregation.AggregationMetadata.ParameterMetadata)1 ParameterType (com.facebook.presto.operator.aggregation.AggregationMetadata.ParameterMetadata.ParameterType)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)1