presto-main/src/main/java/io/prestosql/operator/aggregation/TypedKeyValueHeap.java/TypedKeyValueHeap/deserialize
class TypedKeyValueHeap:    public static TypedKeyValueHeap deserialize(Block block, Type keyType, Type valueType, BlockComparator blockComparator)
    {
        int capacity = toIntExact(BIGINT.getLong(block, 0));
        Block keysBlock = new ArrayType(keyType).getObject(block, 1);
        Block valuesBlock = new ArrayType(valueType).getObject(block, 2);
        TypedKeyValueHeap heap = new TypedKeyValueHeap(blockComparator, keyType, valueType, capacity);
        heap.addAll(keysBlock, valuesBlock);
        return heap;
    }