1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::array::{MutableArray, MutableBooleanArray};
use parquet2::statistics::{BooleanStatistics, Statistics as ParquetStatistics};

use crate::error::Result;

pub(super) fn push(
    from: Option<&dyn ParquetStatistics>,
    min: &mut dyn MutableArray,
    max: &mut dyn MutableArray,
) -> Result<()> {
    let min = min
        .as_mut_any()
        .downcast_mut::<MutableBooleanArray>()
        .unwrap();
    let max = max
        .as_mut_any()
        .downcast_mut::<MutableBooleanArray>()
        .unwrap();
    let from = from.map(|s| s.as_any().downcast_ref::<BooleanStatistics>().unwrap());
    min.push(from.and_then(|s| s.min_value));
    max.push(from.and_then(|s| s.max_value));
    Ok(())
}