presto-main/src/main/java/io/prestosql/operator/aggregation/DoubleHistogramAggregation.java/DoubleHistogramAggregation/output
class DoubleHistogramAggregation:    @OutputFunction("map(double,double)")
    public static void output(@AggregationState State state, BlockBuilder out)
    {
        if (state.get() == null) {
            out.appendNull();
        }
        else {
            Map<Double, Double> value = state.get().getBuckets();

            BlockBuilder entryBuilder = out.beginBlockEntry();
            for (Map.Entry<Double, Double> entry : value.entrySet()) {
                DoubleType.DOUBLE.writeDouble(entryBuilder, entry.getKey());
                DoubleType.DOUBLE.writeDouble(entryBuilder, entry.getValue());
            }
            out.closeEntry();
        }
    }