presto-main/src/main/java/io/prestosql/operator/aggregation/state/NullableLongStateSerializer.java/NullableLongStateSerializer/serialize
class NullableLongStateSerializer:    @Override
    public void serialize(NullableLongState state, BlockBuilder out)
    {
        if (state.isNull()) {
            out.appendNull();
        }
        else {
            BIGINT.writeLong(out, state.getLong());
        }
    }