public static SqlAggregation from(QueryDataType operandType, boolean distinct) {
        SqlAggregation aggregation = from(operandType);
        return distinct ? new DistinctSqlAggregation(aggregation) : aggregation;
    }
@Test
    public void test_serialization() {
        SqlAggregation original = AvgSqlAggregations.from(QueryDataType.DECIMAL, false);
        original.accumulate(BigDecimal.ONE);

        InternalSerializationService ss = new DefaultSerializationServiceBuilder().build();
        SqlAggregation serialized = ss.toObject(ss.toData(original));

        assertThat(serialized).isEqualToComparingFieldByField(original);
    }