/// Returns true if the two columns MAY overlap other, based on
/// statistics
Returns true if the two columns MAY overlap other, based on
statistics
Returns true if the two columns MAY overlap other based on statistics
pub fn columns_might_overlap(s1: &ColumnSummary, s2: &ColumnSummary) -> Result<bool> {
        use Statistics::*;
        let overlap = match (&s1.stats, &s2.stats) {
            (I64(s1), I64(s2)) => s1.overlaps(s2),
            (U64(s1), U64(s2)) => s1.overlaps(s2),
            (F64(s1), F64(s2)) => s1.overlaps(s2),
            (Bool(s1), Bool(s2)) => s1.overlaps(s2),
            (String(s1), String(s2)) => s1.overlaps(s2),
            _ => {
                return MismatchedStatsTypes {
                    column_name: s1.name.clone(),
                }
                .fail()
            }
        };
        // If either column has no min/max, treat the column as
        // being entirely null
        let is_none = s1.stats.is_none() || s2.stats.is_none();
        match overlap {
            StatOverlap::NonZero => Ok(true),
            StatOverlap::Zero => Ok(false),
            StatOverlap::Unknown if is_none => Ok(false), // no stats means no values
            // This case means there some stats, but not all.
            // Unclear how this could happen, so throw an error for now
            StatOverlap::Unknown => InternalPartialStatistics {
                column_name: s1.name.clone(),
                s1: s1.stats.clone(),
                s2: s2.stats.clone(),
            }
            .fail(),
        }
    }
pub fn columns_might_overlap ( s1 : & ColumnSummary , s2 : & ColumnSummary ) -> Result < bool > { use Statistics :: * ; let overlap = match ( & s1 . stats , & s2 . stats ) { ( I64 ( s1 ) , I64 ( s2 ) ) => s1 . overlaps ( s2 ) , ( U64 ( s1 ) , U64 ( s2 ) ) => s1 . overlaps ( s2 ) , ( F64 ( s1 ) , F64 ( s2 ) ) => s1 . overlaps ( s2 ) , ( Bool ( s1 ) , Bool ( s2 ) ) => s1 . overlaps ( s2 ) , ( String ( s1 ) , String ( s2 ) ) => s1 . overlaps ( s2 ) , _ => { return MismatchedStatsTypes { column_name : s1 . name . clone ( ) , } . fail ( ) } } ; // If either column has no min/max, treat the column as // being entirely null let is_none = s1 . stats . is_none ( ) || s2 . stats . is_none ( ) ; match overlap { StatOverlap :: NonZero => Ok ( true ) , StatOverlap :: Zero => Ok ( false ) , StatOverlap :: Unknown if is_none => Ok ( false ) , // no stats means no values // This case means there some stats, but not all. // Unclear how this could happen, so throw an error for now StatOverlap :: Unknown => InternalPartialStatistics { column_name : s1 . name . clone ( ) , s1 : s1 . stats . clone ( ) , s2 : s2 . stats . clone ( ) , } . fail ( ) , } }
Returns true if the two columns MAY overlap other, based on
statistics
Returns true if the two columns MAY overlap other based on statistics
s1
&ColumnSummary
s2
&ColumnSummary