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

        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;
                }
                double value = DoubleType.DOUBLE.getDouble(block, i);
                if (isNaN(value)) {
                    continue;
                }
                if (value == -0.0) {
                    value = 0.0;
                }
                if (!minSet || (value < min)) {
                    minSet = true;
                    min = value;
                }
                if (!maxSet || (value > max)) {
                    maxSet = true;
                    max = value;
                }
            }
        }

        if (isInfinite(min)) {
            minSet = false;
        }
        if (isInfinite(max)) {
            maxSet = false;
        }

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