Skip to content

Commit 59b8eaf

Browse files
authored
Merge pull request #9144 from sundy-li/fix-nan
chore(query): fix nan in range filter
2 parents 9071afc + 032cb8d commit 59b8eaf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

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

291-
let min_col = v.data_type().create_constant_column(&stat.min, 1)?;
291+
let min = match &stat.min {
292+
DataValue::Float64(f) if f.is_nan() => &DataValue::Float64(f64::MIN),
293+
other => other,
294+
};
295+
296+
let max = match &stat.max {
297+
DataValue::Float64(f) if f.is_nan() => &DataValue::Float64(f64::MAX),
298+
other => other,
299+
};
300+
301+
let min_col = v.data_type().create_constant_column(min, 1)?;
292302
let variable_left = Some(ColumnWithField::new(min_col, v.clone()));
293303

294-
let max_col = v.data_type().create_constant_column(&stat.max, 1)?;
304+
let max_col = v.data_type().create_constant_column(max, 1)?;
295305
let variable_right = Some(ColumnWithField::new(max_col, v.clone()));
296306
variables.insert(v.name().clone(), (variable_left, variable_right));
297307
}

0 commit comments

Comments
 (0)