@@ -639,22 +639,12 @@ impl Statistics {
639639 col_stats. sum_value = col_stats. sum_value . add ( & item_col_stats. sum_value ) ;
640640 // Use max as a conservative lower bound for distinct count
641641 // (can't accurately merge NDV since duplicates may exist across partitions)
642- col_stats. distinct_count =
643- match ( & col_stats. distinct_count , & item_col_stats. distinct_count ) {
644- ( Precision :: Exact ( a) , Precision :: Exact ( b) )
645- | ( Precision :: Inexact ( a) , Precision :: Exact ( b) )
646- | ( Precision :: Exact ( a) , Precision :: Inexact ( b) )
647- | ( Precision :: Inexact ( a) , Precision :: Inexact ( b) ) => {
648- Precision :: Inexact ( if a >= b { * a } else { * b } )
649- }
650- ( Precision :: Exact ( v) , Precision :: Absent )
651- | ( Precision :: Inexact ( v) , Precision :: Absent )
652- | ( Precision :: Absent , Precision :: Exact ( v) )
653- | ( Precision :: Absent , Precision :: Inexact ( v) ) => {
654- Precision :: Inexact ( * v)
655- }
656- ( Precision :: Absent , Precision :: Absent ) => Precision :: Absent ,
657- } ;
642+ col_stats. distinct_count = col_stats
643+ . distinct_count
644+ . get_value ( )
645+ . max ( item_col_stats. distinct_count . get_value ( ) )
646+ . map ( |& v| Precision :: Inexact ( v) )
647+ . unwrap_or ( Precision :: Absent ) ;
658648 col_stats. byte_size = col_stats. byte_size . add ( & item_col_stats. byte_size ) ;
659649 }
660650
0 commit comments