presto-main/src/main/java/io/prestosql/operator/aggregation/histogram/GroupedTypedHistogram.java/GroupedTypedHistogram/serialize
class GroupedTypedHistogram:    @Override
    public void serialize(BlockBuilder out)
    {
        if (isCurrentGroupEmpty()) {
            out.appendNull();
        }
        else {
            BlockBuilder blockBuilder = out.beginBlockEntry();

            iterateGroupNodes(currentGroupId, nodePointer -> {
                checkArgument(nodePointer != NULL, "should never see null here as we exclude in iterateGroupNodesCall");
                ValueNode valueNode = bucketNodeFactory.createValueNode(nodePointer);
                valueNode.writeNodeAsBlock(values, blockBuilder);
            });

            out.closeEntry();
        }
    }