presto-main/src/main/java/io/prestosql/operator/aggregation/state/NullableDoubleState.java/NullableDoubleState/write
class NullableDoubleState:    static void write(Type type, NullableDoubleState state, BlockBuilder out)
    {
        if (state.isNull()) {
            out.appendNull();
        }
        else {
            type.writeDouble(out, state.getDouble());
        }
    }