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

        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;
                }
                boolean value = BooleanType.BOOLEAN.getBoolean(block, i);
                if (!minSet || Boolean.compare(value, min) < 0) {
                    minSet = true;
                    min = value;
                }
                if (!maxSet || Boolean.compare(value, max) > 0) {
                    maxSet = true;
                    max = value;
                }
            }
        }

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