Search in sources :

Example 1 with DistinctValueClientAggregator

use of org.apache.phoenix.expression.aggregator.DistinctValueClientAggregator in project phoenix by apache.

the class DistinctValueAggregateFunction method newClientAggregator.

@Override
public DistinctValueWithCountClientAggregator newClientAggregator() {
    PDataType baseType = getAggregatorExpression().getDataType().isArrayType() ? PVarbinary.INSTANCE : getAggregatorExpression().getDataType();
    PDataType resultType = PDataType.fromTypeId(baseType.getSqlType() + PDataType.ARRAY_TYPE_BASE);
    return new DistinctValueClientAggregator(getAggregatorExpression().getSortOrder(), baseType, resultType);
}
Also used : PDataType(org.apache.phoenix.schema.types.PDataType) DistinctValueClientAggregator(org.apache.phoenix.expression.aggregator.DistinctValueClientAggregator)

Aggregations

DistinctValueClientAggregator (org.apache.phoenix.expression.aggregator.DistinctValueClientAggregator)1 PDataType (org.apache.phoenix.schema.types.PDataType)1