fix: unwrap() None in NULL value exist multi-field table during prometheus query_range (#1571)

* fix: NULL value in multi-field table meet error in prometheus query_range

* fix: suggestion

* chore: change style
This commit is contained in:
Huaijin
2023-05-12 17:36:03 +08:00
committed by GitHub
parent 4151d7a8ea
commit f9a4326461

View File

@@ -350,10 +350,12 @@ impl PromJsonResponse {
let timestamp = timestamp_millis as f64 / 1000.0;
// retrieve value
let value =
Into::<f64>::into(field_column.get_data(row_index).unwrap()).to_string();
buffer.entry(tags).or_default().push((timestamp, value));
if let Some(v) = field_column.get_data(row_index) {
buffer
.entry(tags)
.or_default()
.push((timestamp, Into::<f64>::into(v).to_string()));
};
}
}