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

        // read percentile
        state.setPercentile(input.readDouble());

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