Search in sources :

Example 1 with ParameterType

use of io.prestosql.operator.aggregation.AggregationMetadata.ParameterMetadata.ParameterType in project hetu-core by openlookeng.

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(io.prestosql.operator.aggregation.AggregationMetadata.ParameterMetadata.ParameterType) ImmutableList(com.google.common.collect.ImmutableList) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ParameterMetadata(io.prestosql.operator.aggregation.AggregationMetadata.ParameterMetadata)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)1 ParameterMetadata (io.prestosql.operator.aggregation.AggregationMetadata.ParameterMetadata)1 ParameterType (io.prestosql.operator.aggregation.AggregationMetadata.ParameterMetadata.ParameterType)1