Skip to content

Commit cef55ae

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

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

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

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

291-
let min_col = v.data_type().create_constant_column(&stat.min, 1)?;
291+
let min = if let DataValue::Float64(f64::NAN) = stat.min {
292+
&DataValue::Float64(f64::MIN)
293+
} else {
294+
&stat.min
295+
};
296+
297+
let max = if let DataValue::Float64(f64::NAN) = stat.max {
298+
&DataValue::Float64(f64::MAX)
299+
} else {
300+
&stat.max
301+
};
302+
303+
let min_col = v.data_type().create_constant_column(min, 1)?;
292304
let variable_left = Some(ColumnWithField::new(min_col, v.clone()));
293305

294-
let max_col = v.data_type().create_constant_column(&stat.max, 1)?;
306+
let max_col = v.data_type().create_constant_column(max, 1)?;
295307
let variable_right = Some(ColumnWithField::new(max_col, v.clone()));
296308
variables.insert(v.name().clone(), (variable_left, variable_right));
297309
}

0 commit comments

Comments
 (0)