Skip to content

Commit 032cb8d

Browse files
committed
chore(query): fix nan in range filter
1 parent cef55ae commit 032cb8d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/query/storages/index/src/range_filter.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,14 @@ impl StatColumn {
288288
single_point = false;
289289
}
290290

291-
let min = if let DataValue::Float64(f64::NAN) = stat.min {
292-
&DataValue::Float64(f64::MIN)
293-
} else {
294-
&stat.min
291+
let min = match &stat.min {
292+
DataValue::Float64(f) if f.is_nan() => &DataValue::Float64(f64::MIN),
293+
other => other,
295294
};
296295

297-
let max = if let DataValue::Float64(f64::NAN) = stat.max {
298-
&DataValue::Float64(f64::MAX)
299-
} else {
300-
&stat.max
296+
let max = match &stat.max {
297+
DataValue::Float64(f) if f.is_nan() => &DataValue::Float64(f64::MAX),
298+
other => other,
301299
};
302300

303301
let min_col = v.data_type().create_constant_column(min, 1)?;

0 commit comments

Comments
 (0)