1#![deny(missing_docs)]
6use std::fmt::Debug;
7
8use datafusion_common::stats::Precision as DFPrecision;
9use vortex::expr::stats::Precision;
10
11mod convert;
12mod persistent;
13pub mod vendor;
14
15pub use convert::exprs::ExpressionConvertor;
16pub use persistent::*;
17
18trait PrecisionExt<T>
20where
21 T: Debug + Clone + PartialEq + Eq + PartialOrd,
22{
23 fn to_df(self) -> DFPrecision<T>;
25}
26
27impl<T> PrecisionExt<T> for Precision<T>
28where
29 T: Debug + Clone + PartialEq + Eq + PartialOrd,
30{
31 fn to_df(self) -> DFPrecision<T> {
32 match self {
33 Precision::Exact(v) => DFPrecision::Exact(v),
34 Precision::Inexact(v) => DFPrecision::Inexact(v),
35 }
36 }
37}
38
39impl<T> PrecisionExt<T> for Option<Precision<T>>
40where
41 T: Debug + Clone + PartialEq + Eq + PartialOrd,
42{
43 fn to_df(self) -> DFPrecision<T> {
44 match self {
45 Some(v) => v.to_df(),
46 None => DFPrecision::Absent,
47 }
48 }
49}