Skip to content

Commit

Permalink
chore: avoid returning error during computing binary comparison selec…
Browse files Browse the repository at this point in the history
…tivity (#16725)
  • Loading branch information
xudong963 authored Oct 30, 2024
1 parent 00393c6 commit af37d28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/query/sql/src/planner/optimizer/property/selectivity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ impl<'a> SelectivityEstimator<'a> {
let col_hist = column_stat.histogram.as_ref();

if col_hist.is_none() && const_datum.is_numeric() {
// If there is no histogram and the column isn't numeric, return default selectivity.
if !column_stat.min.is_numeric() {
return Ok(DEFAULT_SELECTIVITY);
}
let min = column_stat.min.to_double()?;
let max = column_stat.max.to_double()?;
let ndv = column_stat.ndv;
Expand Down

0 comments on commit af37d28

Please sign in to comment.