presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/storage/ShardStats.java/ShardStats/indexString
class ShardStats:    private static ColumnStats indexString(Type type, OrcRecordReader reader, long columnId)
            throws IOException
    {
        boolean minSet = false;
        boolean maxSet = false;
        Slice min = null;
        Slice max = null;

        while (true) {
            Page page = reader.nextPage();
            if (page == null) {
                break;
            }
            Block block = page.getBlock(0).getLoadedBlock();

            for (int i = 0; i < page.getPositionCount(); i++) {
                if (block.isNull(i)) {
                    continue;
                }
                Slice slice = type.getSlice(block, i);
                slice = truncateIndexValue(slice);
                if (!minSet || (slice.compareTo(min) < 0)) {
                    minSet = true;
                    min = slice;
                }
                if (!maxSet || (slice.compareTo(max) > 0)) {
                    maxSet = true;
                    max = slice;
                }
            }
        }

        return new ColumnStats(columnId,
                minSet ? min.toStringUtf8() : null,
                maxSet ? max.toStringUtf8() : null);
    }