presto-main/src/main/java/io/prestosql/operator/aggregation/LongSumAggregation.java/LongSumAggregation/output
class LongSumAggregation:    @OutputFunction(StandardTypes.BIGINT)
    public static void output(@AggregationState LongLongState state, BlockBuilder out)
    {
        if (state.getFirst() == 0) {
            out.appendNull();
        }
        else {
            BigintType.BIGINT.writeLong(out, state.getSecond());
        }
    }