@Override
    public ColumnStatistics buildColumnStatistics()
    {
        Optional<StringStatistics> stringStatistics = buildStringStatistics();
        if (stringStatistics.isPresent()) {
            verify(nonNullValueCount > 0);
            return new StringColumnStatistics(nonNullValueCount, null, rawSize, storageSize, stringStatistics.get());
        }
        return new ColumnStatistics(nonNullValueCount, null, rawSize, storageSize);
    }
@Test
    public void testBlockStringStatistics()
    {
        String alphabets = "abcdefghijklmnopqrstuvwxyz";
        VariableWidthBlockBuilder blockBuilder = new VariableWidthBlockBuilder(null, alphabets.length(), alphabets.length());
        Slice slice = utf8Slice(alphabets);
        for (int i = 0; i < slice.length(); i++) {
            VARCHAR.writeSlice(blockBuilder, slice, i, 1);
        }
        blockBuilder.appendNull();

        StringStatisticsBuilder stringStatisticsBuilder = new StringStatisticsBuilder(1000);
        stringStatisticsBuilder.addBlock(VARCHAR, blockBuilder);

        StringStatistics stringStatistics = stringStatisticsBuilder.buildColumnStatistics().getStringStatistics();
        assertEquals(stringStatistics.getMin(), slice.slice(0, 1));
        assertEquals(stringStatistics.getMax(), slice.slice(slice.length() - 1, 1));
        assertEquals(stringStatistics.getSum(), slice.length());
    }