presto-main/src/main/java/io/prestosql/operator/aggregation/state/DigestAndPercentileArrayStateSerializer.java/DigestAndPercentileArrayStateSerializer/deserialize
class DigestAndPercentileArrayStateSerializer:    @Override
    public void deserialize(Block block, int index, DigestAndPercentileArrayState state)
    {
        SliceInput input = VARBINARY.getSlice(block, index).getInput();

        // read number of percentiles
        int numPercentiles = input.readInt();

        ImmutableList.Builder<Double> percentilesListBuilder = ImmutableList.builder();
        for (int i = 0; i < numPercentiles; i++) {
            percentilesListBuilder.add(input.readDouble());
        }
        state.setPercentiles(percentilesListBuilder.build());

        // read digest
        int length = input.readInt();
        state.setDigest(new QuantileDigest(input.readSlice(length)));
        state.addMemoryUsage(state.getDigest().estimatedInMemorySizeInBytes());
    }