@@ -269,7 +269,10 @@ impl<S: CostModelStorageLayer> CostModelImpl<S> {
269269 ) -> CostModelResult < f64 > {
270270 // TODO: The attribute could be a derived attribute
271271 let ret_sel = {
272- let attribute_stats = self . get_attribute_comb_stats ( table_id, & [ attr_base_index] ) ?;
272+ // TODO: Handle the case where `attribute_stats` is None.
273+ let attribute_stats = self
274+ . get_attribute_comb_stats ( table_id, & [ attr_base_index] ) ?
275+ . unwrap ( ) ;
273276 let eq_freq = if let Some ( freq) = attribute_stats. mcvs . freq ( & vec ! [ Some ( value. clone( ) ) ] )
274277 {
275278 freq
@@ -355,7 +358,10 @@ impl<S: CostModelStorageLayer> CostModelImpl<S> {
355358 end : Bound < & Value > ,
356359 ) -> CostModelResult < f64 > {
357360 // TODO: Consider attribute is a derived attribute
358- let attribute_stats = self . get_attribute_comb_stats ( table_id, & [ attr_base_index] ) ?;
361+ // TODO: Handle the case where `attribute_stats` is None.
362+ let attribute_stats = self
363+ . get_attribute_comb_stats ( table_id, & [ attr_base_index] ) ?
364+ . unwrap ( ) ;
359365 let left_quantile = match start {
360366 Bound :: Unbounded => 0.0 ,
361367 Bound :: Included ( value) => self . get_attribute_lt_value_freq (
@@ -439,7 +445,10 @@ impl<S: CostModelStorageLayer> CostModelImpl<S> {
439445 . min ( 1.0 ) ;
440446
441447 // Compute the selectivity in MCVs.
442- let attribute_stats = self . get_attribute_comb_stats ( table_id, & [ attr_ref_idx] ) ?;
448+ // TODO: Handle the case where `attribute_stats` is None.
449+ let attribute_stats = self
450+ . get_attribute_comb_stats ( table_id, & [ attr_ref_idx] ) ?
451+ . unwrap ( ) ;
443452 let ( mcv_freq, null_frac) = {
444453 let pred = Box :: new ( move |val : & AttributeCombValue | {
445454 let string = StringArray :: from ( vec ! [ val[ 0 ] . as_ref( ) . unwrap( ) . as_str( ) . as_ref( ) ] ) ;
0 commit comments